From ca9ecb247890a4c45623eb23f592ac0bb8ee350a Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 4 Mar 2007 01:58:29 +0000 Subject: [PATCH] fixed NPE. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2321 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index c4d25503d7..531a764d03 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -178,7 +178,10 @@ public class Util { * null if there seems to be no error code or if the platform is not Win32. */ public static String getWin32ErrorMessage(IOException e) { - Matcher m = errorCodeParser.matcher(e.getMessage()); + String msg = e.getMessage(); + if(msg==null) + return null; // no message + Matcher m = errorCodeParser.matcher(msg); if(!m.matches()) return null; // failed to parse