Open ms1111 opened 5 years ago
In StreamingWorkbookReader.init(InputStream), if there's a RuntimeException, f.delete() is called. f may be null at this point, giving a NullPointerException.
StreamingWorkbookReader.init(InputStream)
f.delete()
f
try { f = writeInputStreamToFile(is, builder.getBufferSize()); ... } catch(IOException e) { throw new ReadException("Unable to read input stream", e); } catch(RuntimeException e) { f.delete(); // <---- throw e; }
This is pretty harmless, but it does hide the original exception. I suppose it just needs an if (f != null) guard.
if (f != null)
Good catch, we should definitely add a null guard there.
In
StreamingWorkbookReader.init(InputStream)
, if there's a RuntimeException,f.delete()
is called.f
may be null at this point, giving a NullPointerException.This is pretty harmless, but it does hide the original exception. I suppose it just needs an
if (f != null)
guard.