dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 229 forks source link

NPE in CacheListCommand #2247

Closed isoos closed 1 year ago

isoos commented 5 years ago

This is probably not new, I've just ignored it for a while. When pana runs pub cache list with package:syntax 0.2.0 it gets this exception:

  Exception: Problem running proc: exit code - 1<***><***>The getter 'name' was called on null.
  Receiver: null
  Tried calling: name
  dart:core                                                          Object.noSuchMethod
  package:pub/src/command/cache_list.dart 25:57                      CacheListCommand.run
  package:args/command_runner.dart 197:27                            CommandRunner.runCommand
  ===== asynchronous gap ===========================
  package:pub/src/command_runner.dart 171:39                         PubCommandRunner.runCommand.<fn>
  dart:async                                                         new Future.sync
  package:pub/src/utils.dart 109:12                                  captureErrors.<fn>
  dart:async                                                         runZoned
  package:pub/src/utils.dart 126:5                                   captureErrors
  package:pub/src/command_runner.dart 171:13                         PubCommandRunner.runCommand
  ===== asynchronous gap ===========================
  package:pub/src/command_runner.dart 119:11                         PubCommandRunner.run
  ===== asynchronous gap ===========================
  /b/s/w/ir/cache/builder/sdk/third_party/pkg/pub/bin/pub.dart 8:22  main
sigurdm commented 1 year ago

This can no longer happen as we are null-safe.

I cannot reproduce because package:syntax has been removed.

Please reopen if you can still reproduce a related problem.