Fixed Bug: AXIS2C-1674. Simple HttpServer crashes when reading directories in Windows 2012 Server	
diff --git a/util/src/stream.c b/util/src/stream.c
index 3f6a711..3592538 100644
--- a/util/src/stream.c
+++ b/util/src/stream.c
@@ -102,6 +102,14 @@
     axutil_stream_t *stream,
     const axutil_env_t *env)
 {
+	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+	//avoid access violation / segment fault
+	if (stream == NULL)
+	{
+		return;
+	}
+
     switch(stream->stream_type)
     {
         case AXIS2_STREAM_BASIC: