inputoutputstream fd fix
[nestedvm.git] / src / org / ibex / nestedvm / Runtime.java
index c501d0d..50b5162 100644 (file)
@@ -1194,8 +1194,8 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
         }
         
         public void _close() {
         }
         
         public void _close() {
-            try {is.close(); } catch(IOException e) { /*ignore*/ }
-            try {os.close(); } catch(IOException e) { /*ignore*/ }
+            if(is != null) try { is.close(); } catch(IOException e) { /*ignore*/ }
+            if(os != null) try { os.close(); } catch(IOException e) { /*ignore*/ }
         }
         
         public int read(byte[] a, int off, int length) throws ErrnoException {
         }
         
         public int read(byte[] a, int off, int length) throws ErrnoException {