Index: runtime/bin/socket_patch.dart |
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart |
index 09904b433de13c0144bcca0949fc509ab205b187..1ec51b77795faff13c3a030cd6c553d4ed713ba3 100644 |
--- a/runtime/bin/socket_patch.dart |
+++ b/runtime/bin/socket_patch.dart |
@@ -1243,9 +1243,11 @@ class _RawSocket extends Stream<RawSocketEvent> |
native.isClosedWrite = true; |
if (fd != null) _getStdioHandle(native, fd); |
var result = new _RawSocket(native); |
- result._isMacOSTerminalInput = |
- Platform.isMacOS && |
- _StdIOUtils._socketType(result._socket) == _STDIO_HANDLE_TYPE_TERMINAL; |
+ if (fd != null) { |
+ var socketType = _StdIOUtils._socketType(result._socket); |
+ result._isMacOSTerminalInput = |
+ Platform.isMacOS && socketType == _STDIO_HANDLE_TYPE_TERMINAL; |
+ } |
return result; |
} |