iMyth / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
1 stars 0 forks source link

NPE in StreamResource #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
*** This issue was imported from http://java.net/jira/browse/XHTMLRENDERER-309

It was reported by bago on 12.01.2010 22:16:34 +0100 and last updated in the 
previous bug tracker on 12.01.2010 22:16:34 +0100

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.

Original description: 
When StreamResource.connect receive an exception it is caught and not retrown. 
So _conn could be null. but bufferedStream() methods doens't protect from NPE.

Not sure if the contract should be that connect raise the exception or if 
bufferedStream should raise the exception, but raising it in bufferedStream 
temporarily fixed the NPE:

    public BufferedInputStream bufferedStream() throws IOException {
        if (_conn == null) throw new IOException();

Original issue reported on code.google.com by pdoubl...@gmail.com on 16 Feb 2011 at 9:47