From fa64bab806b72012251590e955016d9540e7b1fe Mon Sep 17 00:00:00 2001 From: Hidenori Matsubayashi Date: Thu, 24 Aug 2023 20:18:35 +0000 Subject: [PATCH] upgrade: fix error messages when using upgrade command (#210) This change fixes the following error messages when using upgrade command. ``` $ flutter-elinux upgrade flutter-elinux is already up to date Null check operator used on a null value #0 ELinuxUpgradeCommandRunner.runCommandFirstHalf (package:flutter_elinux/commands/upgrade.dart:99:49) #1 ELinuxUpgradeCommandRunner.runCommand (package:flutter_elinux/commands/upgrade.dart:72:7) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1297:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:339:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:285:5) #8 run.. (package:flutter_tools/runner.dart:115:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 main (package:flutter_elinux/executable.dart:80:3) ``` Signed-off-by: Hidenori Matsubayashi --- lib/commands/upgrade.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/commands/upgrade.dart b/lib/commands/upgrade.dart index 73231bc..539acef 100644 --- a/lib/commands/upgrade.dart +++ b/lib/commands/upgrade.dart @@ -96,7 +96,9 @@ class ELinuxUpgradeCommandRunner { if (currentVersion.hash == upstreamVersion.hash) { globals.printStatus('flutter-elinux is already up to date'); - globals.printStatus(upstreamVersion.gitTag!); + if (upstreamVersion.gitTag != null) { + globals.printStatus(upstreamVersion.gitTag!); + } return; }