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

Commit

Permalink
fix: _environmentMap to return empty map when input is null
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Nov 19, 2024
1 parent 646e5ff commit 1d5eaee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/pubspec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class Pubspec {
Version? _versionFromString(String? input) =>
input == null ? null : Version.parse(input);

Map<String, VersionConstraint?>? _environmentMap(Map? source) =>
Map<String, VersionConstraint?> _environmentMap(Map? source) =>
source?.map((k, value) {
final key = k as String;
if (key == 'dart') {
Expand Down Expand Up @@ -222,4 +222,5 @@ Map<String, VersionConstraint?>? _environmentMap(Map? source) =>
}

return MapEntry(key, constraint);
});
}) ??
{};

0 comments on commit 1d5eaee

Please sign in to comment.