NPE in PluginManager when asking for list on non existing dir
Asking for list of installed plugins with no existing plugin dir: ```sh $ bin/plugin --list ``` It causes a NPE in PluginManager. Closes #3253.
This commit is contained in:
parent
2fb5d3ff51
commit
f5e5eb5fb9
|
@ -297,12 +297,12 @@ public class PluginManager {
|
|||
public void listInstalledPlugins() {
|
||||
File[] plugins = environment.pluginsFile().listFiles();
|
||||
System.out.println("Installed plugins:");
|
||||
if (plugins.length == 0) {
|
||||
if (plugins == null || plugins.length == 0) {
|
||||
System.out.println(" - No plugin detected in " + environment.pluginsFile().getAbsolutePath());
|
||||
}
|
||||
|
||||
for (int i = 0; i < plugins.length; i++) {
|
||||
System.out.println(" - " + plugins[i].getName());
|
||||
} else {
|
||||
for (int i = 0; i < plugins.length; i++) {
|
||||
System.out.println(" - " + plugins[i].getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue