You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2022/04/15 13:09:09 UTC
[wicket] branch master updated: [WICKET-6971] NullPointerException in ModificationWatcher (#510)
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new 541615be7d [WICKET-6971] NullPointerException in ModificationWatcher (#510)
541615be7d is described below
commit 541615be7d6fec61db84e6f1f94fc65227d22eef
Author: Ryo <tr...@gmail.com>
AuthorDate: Fri Apr 15 22:09:02 2022 +0900
[WICKET-6971] NullPointerException in ModificationWatcher (#510)
---
.../src/main/java/org/apache/wicket/util/io/Connections.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/wicket-util/src/main/java/org/apache/wicket/util/io/Connections.java b/wicket-util/src/main/java/org/apache/wicket/util/io/Connections.java
index 13d50c2a00..b7f419fa66 100644
--- a/wicket-util/src/main/java/org/apache/wicket/util/io/Connections.java
+++ b/wicket-util/src/main/java/org/apache/wicket/util/io/Connections.java
@@ -18,6 +18,7 @@ package org.apache.wicket.util.io;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.JarURLConnection;
import java.net.URL;
@@ -129,7 +130,12 @@ public class Connections
// otherwise it leaks open file handles. See WICKET-4359.
// Most other connection types should not call getInputStream() here,
// especially remote connections.
- connection.getInputStream().close();
+ InputStream inputStream = connection.getInputStream();
+
+ if (inputStream != null)
+ {
+ inputStream.close();
+ }
}
if (connection instanceof HttpURLConnection)