Fix a crashing bug. If a SyncPackageResolver is passed in without any package resolution strategy, this would throw a method not found exception. R=jmesserly@google.com Review URL: https://codereview.chromium.org//2187043003 .
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7513300..f7c2dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md
@@ -1,3 +1,7 @@ +## 1.1.1 + +* Don't crash if the `SyncPackageResolver` has no package information at all. + ## 1.1.0 * `mapStackTrace()` now uses a `SyncPackageResolver` object from the
diff --git a/lib/source_map_stack_trace.dart b/lib/source_map_stack_trace.dart index 63c5a7a..5d6664c 100644 --- a/lib/source_map_stack_trace.dart +++ b/lib/source_map_stack_trace.dart
@@ -76,7 +76,7 @@ p.url.isWithin(packageResolver.packageRoot.toString(), sourceUrl)) { sourceUrl = "package:" + p.url.relative(sourceUrl, from: packageResolver.packageRoot.toString()); - } else { + } else if (packageResolver.packageConfig != null) { for (var package in packageResolver.packageConfigMap.keys) { var packageUrl = packageResolver.packageConfigMap[package].toString(); if (!p.url.isWithin(packageUrl, sourceUrl)) continue;
diff --git a/pubspec.yaml b/pubspec.yaml index b59a503..0feb7f5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml
@@ -1,5 +1,5 @@ name: source_map_stack_trace -version: 1.1.0 +version: 1.1.1 description: > A package for applying source maps to stack traces. author: Dart Team <misc@dartlang.org>