Archiviert
13
0

Make sure the plugins folder actually exists before iterating

Dieser Commit ist enthalten in:
Dan Mulloy 2016-01-09 12:31:20 -05:00
Ursprung 8e8cf54ddd
Commit 39998eedf8

Datei anzeigen

@ -501,6 +501,8 @@ public class ProtocolLibrary extends JavaPlugin {
// The plugin folder isn't always plugins/
File pluginFolder = getDataFolder().getParentFile();
File[] candidates = pluginFolder.listFiles();
if (candidates != null) {
for (File candidate : pluginFolder.listFiles()) {
if (candidate.isFile() && !candidate.equals(loadedFile)) {
Matcher match = ourPlugin.matcher(candidate.getName());
@ -516,6 +518,7 @@ public class ProtocolLibrary extends JavaPlugin {
}
}
}
}
} catch (Exception e) {
// TODO This shows [ProtocolLib] and [ProtocolLibrary] in the message
reporter.reportWarning(this, Report.newBuilder(REPORT_CANNOT_DETECT_CONFLICTING_PLUGINS).error(e));