[jcifs] NullPointerException instead of SmbException

DrZubr DrZubr at tut.by
Wed Nov 29 06:33:39 GMT 2006


Sometimes jcifs throws NullPointerException at
DcerpcPipeHandle.close()
May be it is a good idea to replace

out.close();

with

if (out != null) {
   out.close();
}

?

For example this exception is thrown when listFiles() fails with
"Access denied" exception. At DcerpcPipeHandle.doSendFragment
exception is thrown at
in = (SmbFileInputStream) pipe.getNamedPipeInputStream();
and out is not initialized, and then we are trying to close it - and
receive NullPointerException instead of SmbException.



More information about the jcifs mailing list