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(
if (env[envName] != null && env[envName] != '') {
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) {
return argValues;
}
......
......@@ -28,7 +28,6 @@ class Remote {
required RemoteName name,
required this.url,
}) : _name = name,
assert(url != null),
assert(url != '');
factory Remote.mirror(String url) {
......@@ -241,7 +240,6 @@ abstract class Repository {
/// The URL of the remote named [remoteName].
Future<String> remoteUrl(String remoteName) async {
assert(remoteName != null);
return git.getOutput(
<String>['remote', 'get-url', remoteName],
'verify the URL of the $remoteName remote',
......
......@@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) {
} else {
buffer.writeln('0 Engine cherrypicks.');
}
if (state.engine.dartRevision != null &&
state.engine.dartRevision.isNotEmpty) {
if (state.engine.dartRevision.isNotEmpty) {
buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}');
}
buffer.writeln('Framework Repo');
......@@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) {
/// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is
/// passed as an argument, as there is no next phase.
ReleasePhase getNextPhase(ReleasePhase currentPhase) {
assert(currentPhase != null);
final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1);
if (nextPhase == null) {
throw globals.ConductorException('There is no next ReleasePhase!');
......
......@@ -77,7 +77,6 @@ class Version {
/// `flutter --version` and match one of `stablePattern`, `developmentPattern`
/// and `latestPattern`.
factory Version.fromString(String versionString) {
assert(versionString != null);
versionString = versionString.trim();
// 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