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

Unified Diff: sdk/lib/async/broadcast_stream_controller.dart

Issue 598993002: Add missing null-tests to async error functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | sdk/lib/async/future.dart » ('j') | sdk/lib/async/future.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/broadcast_stream_controller.dart
diff --git a/sdk/lib/async/broadcast_stream_controller.dart b/sdk/lib/async/broadcast_stream_controller.dart
index cda7c0f960c7ce16effca089b555da257c8c7bc8..3d09739bb56b14c0ef700a496cfef0ff073f5c2e 100644
--- a/sdk/lib/async/broadcast_stream_controller.dart
+++ b/sdk/lib/async/broadcast_stream_controller.dart
@@ -238,10 +238,12 @@ abstract class _BroadcastStreamController<T>
}
void addError(Object error, [StackTrace stackTrace]) {
+ if (error == null) throw new ArgumentError("Error must not be null");
floitsch 2014/09/24 12:59:14 Or make it an asynchronous NullThrownError?
Lasse Reichstein Nielsen 2014/09/24 13:49:57 I can do that everywhere. It would be consistent b
if (!_mayAddEvent) throw _addEventError();
AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
Søren Gjesse 2014/09/24 13:29:31 The five lines seems to be duplicated in a number
Lasse Reichstein Nielsen 2014/09/24 13:49:57 I wish that I could, but it really just conditiona
if (replacement != null) {
error = replacement.error;
+ if (error == null) error = new NullThrownError();
stackTrace = replacement.stackTrace;
}
_sendError(error, stackTrace);
« no previous file with comments | « no previous file | sdk/lib/async/future.dart » ('j') | sdk/lib/async/future.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698