File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
core/src/main/java/hudson Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2633,11 +2633,13 @@ public static String translateModifierKeysForUsersPlatform(String keyboardShortc
26332633 StaplerRequest2 currentRequest = Stapler .getCurrentRequest2 ();
26342634 currentRequest .getWebApp ().getDispatchValidator ().allowDispatch (currentRequest , Stapler .getCurrentResponse2 ());
26352635 String userAgent = currentRequest .getHeader ("User-Agent" );
2636-
2637- List <String > platformsThatUseCommand = List .of ("MAC" , "IPHONE" , "IPAD" );
2638- boolean useCmdKey = platformsThatUseCommand .stream ().anyMatch (e -> userAgent .toUpperCase ().contains (e ));
2639-
2640- return keyboardShortcut .replace ("CMD" , useCmdKey ? "⌘" : "CTRL" );
2636+ if (userAgent != null ) {
2637+ List <String > platformsThatUseCommand = List .of ("MAC" , "IPHONE" , "IPAD" );
2638+ boolean useCmdKey = platformsThatUseCommand .stream ().anyMatch (e -> userAgent .toUpperCase ().contains (e ));
2639+ return keyboardShortcut .replace ("CMD" , useCmdKey ? "⌘" : "CTRL" );
2640+ } else {
2641+ return keyboardShortcut ;
2642+ }
26412643 }
26422644
26432645 @ Restricted (NoExternalUse .class )
You can’t perform that action at this time.
0 commit comments