| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index 0bcf75fd0a2899163b5f00e3fb5bf40447e70c3a..4d9225daa8170ddce139fd878df64d4757de8992 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -490,7 +490,9 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
| if (i == ERROR_EVENT) {
|
| reportError(nativeGetError(), "");
|
| } else if (!isClosed) {
|
| - handler();
|
| + // If the connection is closed right after it's accepted, there's a
|
| + // chance the close-handler is not set.
|
| + if (handler != null) handler();
|
| }
|
| }
|
| }
|
|
|