diff options
author | Paul Hawke <paul.hawke@gmail.com> | 2014-04-23 23:52:54 -0500 |
---|---|---|
committer | Paul Hawke <paul.hawke@gmail.com> | 2014-04-23 23:52:54 -0500 |
commit | fe2c4a9406be4881508e8d9ea7753dd0a7727cde (patch) | |
tree | 49911b4b18a2ca9174abe3a4a84f4c56d12f62be /core/src | |
parent | 3c24d71cb9f63f817c358c4f801bec01f1528ad9 (diff) | |
parent | ad3ccf027ec060e1adb3c9b6c577a8ebf32866b2 (diff) | |
download | nanohttpd-fe2c4a9406be4881508e8d9ea7753dd0a7727cde.tar.gz |
Merge pull request #104 from yankee42/master
Return null value leads to NullPointerException
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/fi/iki/elonen/NanoHTTPD.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java index 38e023d..06b9318 100644 --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java @@ -1211,7 +1211,7 @@ public abstract class NanoHTTPD { dest.write(src.slice()); path = tempFile.getName(); } catch (Exception e) { // Catch exception if any - System.err.println("Error: " + e.getMessage()); + throw new Error(e); // we won't recover, so throw an error } finally { safeClose(fileOutputStream); } @@ -1224,9 +1224,8 @@ public abstract class NanoHTTPD { TempFile tempFile = tempFileManager.createTempFile(); return new RandomAccessFile(tempFile.getName(), "rw"); } catch (Exception e) { - System.err.println("Error: " + e.getMessage()); + throw new Error(e); // we won't recover, so throw an error } - return null; } /** |