Skip to content

Commit ec51d32

Browse files
authored
Remove unnecessary null checks in ‘dev/conductor’ (#118843)
* Remove unnecessary null checks in dev/conductor * review
1 parent 9acf34d commit ec51d32

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

dev/conductor/core/lib/src/globals.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ List<String> getValuesFromEnvOrArgs(
126126
if (env[envName] != null && env[envName] != '') {
127127
return env[envName]!.split(',');
128128
}
129-
final List<String> argValues = argResults[name] as List<String>;
129+
final List<String>? argValues = argResults[name] as List<String>?;
130130
if (argValues != null) {
131131
return argValues;
132132
}

dev/conductor/core/lib/src/repository.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class Remote {
2828
required RemoteName name,
2929
required this.url,
3030
}) : _name = name,
31-
assert(url != null),
3231
assert(url != '');
3332

3433
factory Remote.mirror(String url) {
@@ -241,7 +240,6 @@ abstract class Repository {
241240

242241
/// The URL of the remote named [remoteName].
243242
Future<String> remoteUrl(String remoteName) async {
244-
assert(remoteName != null);
245243
return git.getOutput(
246244
<String>['remote', 'get-url', remoteName],
247245
'verify the URL of the $remoteName remote',

dev/conductor/core/lib/src/state.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) {
8686
} else {
8787
buffer.writeln('0 Engine cherrypicks.');
8888
}
89-
if (state.engine.dartRevision != null &&
90-
state.engine.dartRevision.isNotEmpty) {
89+
if (state.engine.dartRevision.isNotEmpty) {
9190
buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}');
9291
}
9392
buffer.writeln('Framework Repo');
@@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) {
271270
/// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is
272271
/// passed as an argument, as there is no next phase.
273272
ReleasePhase getNextPhase(ReleasePhase currentPhase) {
274-
assert(currentPhase != null);
275273
final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1);
276274
if (nextPhase == null) {
277275
throw globals.ConductorException('There is no next ReleasePhase!');

dev/conductor/core/lib/src/version.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class Version {
7777
/// `flutter --version` and match one of `stablePattern`, `developmentPattern`
7878
/// and `latestPattern`.
7979
factory Version.fromString(String versionString) {
80-
assert(versionString != null);
8180

8281
versionString = versionString.trim();
8382
// stable tag

0 commit comments

Comments
 (0)