From 6a3e60ef71900704e552a295a802c2caf29a871c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 25 Jan 2018 17:48:02 -0500 Subject: [PATCH] [JENKINS-46041] If guessBrowser fails, return null and move on. --- core/src/main/java/hudson/scm/SCM.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/scm/SCM.java b/core/src/main/java/hudson/scm/SCM.java index c33810a7f8f4..2b1e94bb11ea 100644 --- a/core/src/main/java/hudson/scm/SCM.java +++ b/core/src/main/java/hudson/scm/SCM.java @@ -54,6 +54,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -86,6 +88,8 @@ @ExportedBean public abstract class SCM implements Describable, ExtensionPoint { + private static final Logger LOGGER = Logger.getLogger(SCM.class.getName()); + /** JENKINS-35098: discouraged */ @SuppressWarnings("FieldMayBeFinal") private static boolean useAutoBrowserHolder = SystemProperties.getBoolean(SCM.class.getName() + ".useAutoBrowserHolder"); @@ -143,7 +147,12 @@ public String getType() { } return autoBrowserHolder.get(); } else { - return guessBrowser(); + try { + return guessBrowser(); + } catch (RuntimeException x) { + LOGGER.log(Level.WARNING, null, x); + return null; + } } }