From 30bf9145d7d06e0b59fc12475b536524ffa26dcb Mon Sep 17 00:00:00 2001 From: jglick Date: Sun, 29 Apr 2007 17:04:25 +0000 Subject: [PATCH] Mystery NPE. Something to do with a FishEyeCVS URL validation timing out on a hung server. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3268 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/util/FormFieldValidator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/hudson/util/FormFieldValidator.java b/core/src/main/java/hudson/util/FormFieldValidator.java index 4041c2ef69..a1faff9e1c 100644 --- a/core/src/main/java/hudson/util/FormFieldValidator.java +++ b/core/src/main/java/hudson/util/FormFieldValidator.java @@ -91,6 +91,9 @@ public abstract class FormFieldValidator { protected BufferedReader open(URL url) throws IOException { // use HTTP content type to find out the charset. URLConnection con = url.openConnection(); + if (con == null) { // XXX is this even permitted by URL.openConnection? + throw new IOException(url.toExternalForm()); + } return new BufferedReader( new InputStreamReader(con.getInputStream(),getCharset(con))); }