DDF-399 added null check for input stream