Skip to content

Commit

Permalink
change from catch for nullpointer to if
Browse files Browse the repository at this point in the history
  • Loading branch information
SylivanKenobi authored and akram committed Oct 10, 2022
1 parent a322415 commit 08c2439
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ public static ListBoxModel doFillCredentialsIdItems(String credentialsId) {
// relevent class loader. If the plugin is not installed, it is just ignored
try {
PluginWrapper plugin = Jenkins.get().pluginManager.getPlugin(OPENSHIFT_SYNC_PLUGIN_NAME);
Class clazz = plugin.classLoader.loadClass(IO_OPENSHIFT_CREDENTIALS_CLASS_NAME);
standardListBoxModel.includeAs(ACL.SYSTEM, Jenkins.get(), clazz);
if (plugin != null) {
Class clazz = plugin.classLoader.loadClass(IO_OPENSHIFT_CREDENTIALS_CLASS_NAME);
standardListBoxModel.includeAs(ACL.SYSTEM, Jenkins.get(), clazz);
}
} catch (ClassNotFoundException e) {
LOGGER.warning("Class not found: " + IO_OPENSHIFT_CREDENTIALS_CLASS_NAME);
}
Expand Down

0 comments on commit 08c2439

Please sign in to comment.