Permalink
Browse files

Clarify state when asking for caps with no platforms

  • Loading branch information...
kenzierocks committed Dec 29, 2018
1 parent 862b63d commit 2f8bdccf650bdf5e9c94a6d7633ab272fd839096
@@ -167,7 +167,12 @@ public synchronized Platform queryCapability(Capability capability) throws NoCap
return platform;
} else {
if (preferences.isEmpty()) {
return platforms.get(0); // Use the first available if preferences have not been decided yet.
// Use the first available if preferences have not been decided yet.
if (platforms.isEmpty()) {
// No platforms registered, this is being called too early!
throw new NoCapablePlatformException("No platforms have been registered yet! Please wait until WorldEdit is initialized.");
}
return platforms.get(0);
}
throw new NoCapablePlatformException("No platform was found supporting " + capability.name());
}

0 comments on commit 2f8bdcc

Please sign in to comment.