Unverified Commit ec51d327 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove unnecessary null checks in ‘dev/conductor’ (#118843)

* Remove unnecessary null checks in dev/conductor

* review
parent 9acf34d0
...@@ -126,7 +126,7 @@ List<String> getValuesFromEnvOrArgs( ...@@ -126,7 +126,7 @@ List<String> getValuesFromEnvOrArgs(
if (env[envName] != null && env[envName] != '') { if (env[envName] != null && env[envName] != '') {
return env[envName]!.split(','); return env[envName]!.split(',');
} }
final List<String> argValues = argResults[name] as List<String>; final List<String>? argValues = argResults[name] as List<String>?;
if (argValues != null) { if (argValues != null) {
return argValues; return argValues;
} }
......
...@@ -28,7 +28,6 @@ class Remote { ...@@ -28,7 +28,6 @@ class Remote {
required RemoteName name, required RemoteName name,
required this.url, required this.url,
}) : _name = name, }) : _name = name,
assert(url != null),
assert(url != ''); assert(url != '');
factory Remote.mirror(String url) { factory Remote.mirror(String url) {
...@@ -241,7 +240,6 @@ abstract class Repository { ...@@ -241,7 +240,6 @@ abstract class Repository {
/// The URL of the remote named [remoteName]. /// The URL of the remote named [remoteName].
Future<String> remoteUrl(String remoteName) async { Future<String> remoteUrl(String remoteName) async {
assert(remoteName != null);
return git.getOutput( return git.getOutput(
<String>['remote', 'get-url', remoteName], <String>['remote', 'get-url', remoteName],
'verify the URL of the $remoteName remote', 'verify the URL of the $remoteName remote',
......
...@@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) { ...@@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) {
} else { } else {
buffer.writeln('0 Engine cherrypicks.'); buffer.writeln('0 Engine cherrypicks.');
} }
if (state.engine.dartRevision != null && if (state.engine.dartRevision.isNotEmpty) {
state.engine.dartRevision.isNotEmpty) {
buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}'); buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}');
} }
buffer.writeln('Framework Repo'); buffer.writeln('Framework Repo');
...@@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) { ...@@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) {
/// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is /// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is
/// passed as an argument, as there is no next phase. /// passed as an argument, as there is no next phase.
ReleasePhase getNextPhase(ReleasePhase currentPhase) { ReleasePhase getNextPhase(ReleasePhase currentPhase) {
assert(currentPhase != null);
final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1); final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1);
if (nextPhase == null) { if (nextPhase == null) {
throw globals.ConductorException('There is no next ReleasePhase!'); throw globals.ConductorException('There is no next ReleasePhase!');
......
...@@ -77,7 +77,6 @@ class Version { ...@@ -77,7 +77,6 @@ class Version {
/// `flutter --version` and match one of `stablePattern`, `developmentPattern` /// `flutter --version` and match one of `stablePattern`, `developmentPattern`
/// and `latestPattern`. /// and `latestPattern`.
factory Version.fromString(String versionString) { factory Version.fromString(String versionString) {
assert(versionString != null);
versionString = versionString.trim(); versionString = versionString.trim();
// stable tag // stable tag
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment