Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Unhandled exception, due to packageRoot returning null instead of empty string  #6

Description

@sebe

Hi, the dart sdk v1.14.0 returns a Null now instead of empty string, for packageRoot.
I just updated my local copy of standalone.dart to test for null first and it work fine now.
if (packageRoot != null && packageRoot.isNotEmpty && p.startsWith(_packagesPrefix)) {

Next time someone does an update, maybe they could look at this.

api details
++++++++++++
change from
https://api.dartlang.org/1.13.2/dart-io/Platform/packageRoot.html
If there is no --package-root flag, then the empty string is returned.
to
https://api.dartlang.org/1.14.0/dart-io/Platform/packageRoot.html
If there is no --package-root flag, then null is returned.

Error details
+++++++++++++++++
Unhandled exception:
The null object does not have a getter 'isNotEmpty'.

NoSuchMethodError: method not found: 'isNotEmpty'
Receiver: null
Arguments: []
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 _loadAsBytes (package:timezone/standalone.dart:48:21)
#3 initializeTimeZone (package:timezone/standalone.dart:95:10)
#4 main (file:///home/pi/time_dart14/main.dart:5:4)
#5 _startIsolate. (dart:isolate-patch/isolate_patch.dart:261)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions