Skip to content

Commit

Permalink
Clarify state when asking for caps with no platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Dec 29, 2018
1 parent 862b63d commit 2f8bdcc
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -167,7 +167,12 @@ public synchronized Platform queryCapability(Capability capability) throws NoCap
return platform; return platform;
} else { } else {
if (preferences.isEmpty()) { 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()); throw new NoCapablePlatformException("No platform was found supporting " + capability.name());
} }
Expand Down

0 comments on commit 2f8bdcc

Please sign in to comment.