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))); }