@@ -37,9 +37,7 @@ class UnpublishException implements Exception {
37
37
@override
38
38
String toString () {
39
39
String output = runtimeType.toString ();
40
- if (message != null ) {
41
- output += ': $message ' ;
42
- }
40
+ output += ': $message ' ;
43
41
final String stderr = result? .stderr as String ? ?? '' ;
44
42
if (stderr.isNotEmpty) {
45
43
output += ':\n $stderr ' ;
@@ -113,9 +111,7 @@ class ProcessRunner {
113
111
this .subprocessOutput = true ,
114
112
this .defaultWorkingDirectory,
115
113
this .platform = const LocalPlatform (),
116
- }) : assert (subprocessOutput != null ),
117
- assert (processManager != null ),
118
- assert (platform != null ) {
114
+ }) {
119
115
environment = Map <String , String >.from (platform.environment);
120
116
}
121
117
@@ -255,9 +251,6 @@ class ArchiveUnpublisher {
255
251
continue ;
256
252
}
257
253
final Map <String , String > replacementRelease = releases.firstWhere ((Map <String , String > value) => value['channel' ] == getChannelName (channel));
258
- if (replacementRelease == null ) {
259
- throw UnpublishException ('Unable to find previous release for channel ${getChannelName (channel )}.' );
260
- }
261
254
(jsonData['current_release' ] as Map <String , dynamic >)[getChannelName (channel)] = replacementRelease['hash' ];
262
255
print (
263
256
'${confirmed ? 'Reverting' : 'Would revert' } current ${getChannelName (channel )} '
@@ -468,7 +461,7 @@ Future<void> main(List<String> rawArguments) async {
468
461
final String tempDirArg = parsedArguments['temp_dir' ] as String ;
469
462
Directory tempDir;
470
463
bool removeTempDir = false ;
471
- if (tempDirArg == null || tempDirArg .isEmpty) {
464
+ if (tempDirArg.isEmpty) {
472
465
tempDir = Directory .systemTemp.createTempSync ('flutter_package.' );
473
466
removeTempDir = true ;
474
467
} else {
0 commit comments