ExternalStream.st
changeset 7737 616d849b7838
parent 7700 767e11efc326
child 7801 d930c353588d
--- a/ExternalStream.st	Tue Nov 04 18:53:51 2003 +0100
+++ b/ExternalStream.st	Mon Nov 10 12:46:38 2003 +0100
@@ -5539,7 +5539,11 @@
 		c = __intVal(__characterVal(aCharacter)) & 0xFF;
     doWrite:
 		f = __FILEVal(fp);
-
+	        if (! f) {
+	            fprintf(stderr, "oops - fileHandle is NULL in nextPut:\n");
+		    __INST(filePointer) = nil;
+	            goto out;
+	        }
 
 		if (_buffered = (__INST(buffered) == true)) {
 		    __WRITING__(f)
@@ -5568,6 +5572,7 @@
 	    }
 	}
     }
+out: ;
 %}.
     lastErrorNumber notNil ifTrue:[self writeError. ^ self].
     filePointer isNil ifTrue:[self errorNotOpen. ^ self].
@@ -5608,6 +5613,11 @@
 	&& (__INST(mode) != @symbol(readonly))
     ) {
 	f = __FILEVal(fp);
+	if (! f) {
+	    fprintf(stderr, "oops - fileHandle is NULL in nextPutAll:\n");
+	    __INST(filePointer) = nil;
+	    goto out;
+	}
 	if (_buffered = (__INST(buffered) == true)) {
 	    __WRITING__(f)
 	}
@@ -5759,7 +5769,7 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.262 2003-10-27 18:03:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.263 2003-11-10 11:46:38 cg Exp $'
 ! !
 
 ExternalStream initialize!