Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: pkg/intl/lib/generate_localized.dart

Issue 22986014: Add a null check to avoid trying to load libraries that don't exist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/intl/test/message_extraction/sample_with_messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/generate_localized.dart
diff --git a/pkg/intl/lib/generate_localized.dart b/pkg/intl/lib/generate_localized.dart
index 95163724ea228c92071b2ab5140c5f631fdde6a0..647702378b8eb032fe78b93ce64f9c5a423ebdeb 100644
--- a/pkg/intl/lib/generate_localized.dart
+++ b/pkg/intl/lib/generate_localized.dart
@@ -215,7 +215,8 @@ const closing = """
Future initializeMessages(String localeName) {
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
- return deferredLibraries[localeName].load();
+ var lib = deferredLibraries[localeName];
+ return lib == null ? new Future.value(false) : lib.load();
}
MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
« no previous file with comments | « no previous file | pkg/intl/test/message_extraction/sample_with_messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698