Index: generic/tclIOCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOCmd.c,v
retrieving revision 1.65
diff -u -r1.65 tclIOCmd.c
--- generic/tclIOCmd.c	18 Nov 2009 21:59:50 -0000	1.65
+++ generic/tclIOCmd.c	11 Feb 2010 14:54:39 -0000
@@ -1171,7 +1171,7 @@
 		break;
 	    }
 	    chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags);
-	    if (binary) {
+	    if ((chan != NULL) && binary) {
 		Tcl_SetChannelOption(interp, chan, "-translation", "binary");
 	    }
 	}
