File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
ProtocolLib/src/main/java/com/comphenix/protocol Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -501,17 +501,20 @@ private void checkConflictingVersions() {
501
501
// The plugin folder isn't always plugins/
502
502
File pluginFolder = getDataFolder ().getParentFile ();
503
503
504
- for (File candidate : pluginFolder .listFiles ()) {
505
- if (candidate .isFile () && !candidate .equals (loadedFile )) {
506
- Matcher match = ourPlugin .matcher (candidate .getName ());
507
- if (match .matches ()) {
508
- MinecraftVersion version = new MinecraftVersion (match .group (1 ));
509
-
510
- if (candidate .length () == 0 ) {
511
- // Delete and inform the user
512
- logger .info ((candidate .delete () ? "Deleted " : "Could not delete " ) + candidate );
513
- } else if (newestVersion == null || newestVersion .compareTo (version ) < 0 ) {
514
- newestVersion = version ;
504
+ File [] candidates = pluginFolder .listFiles ();
505
+ if (candidates != null ) {
506
+ for (File candidate : pluginFolder .listFiles ()) {
507
+ if (candidate .isFile () && !candidate .equals (loadedFile )) {
508
+ Matcher match = ourPlugin .matcher (candidate .getName ());
509
+ if (match .matches ()) {
510
+ MinecraftVersion version = new MinecraftVersion (match .group (1 ));
511
+
512
+ if (candidate .length () == 0 ) {
513
+ // Delete and inform the user
514
+ logger .info ((candidate .delete () ? "Deleted " : "Could not delete " ) + candidate );
515
+ } else if (newestVersion == null || newestVersion .compareTo (version ) < 0 ) {
516
+ newestVersion = version ;
517
+ }
515
518
}
516
519
}
517
520
}
You can’t perform that action at this time.
0 commit comments