check if InputStream instance is null in order   to prevent NPE