mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Change NPE to IllegalState in Sponge loader's jarinjar presence check
This commit is contained in:
parent
bbfa71a4b2
commit
da882301bc
@ -39,7 +39,6 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@Plugin("discordsrv")
|
@Plugin("discordsrv")
|
||||||
@ -102,7 +101,11 @@ public class DiscordSRVSpongeLoader implements ILoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull URL getJarInJarResource() {
|
public @NotNull URL getJarInJarResource() {
|
||||||
return Objects.requireNonNull(getParentClassLoader().getResource("sponge.jarinjar"));
|
URL resource = getParentClassLoader().getResource("sponge.jarinjar");
|
||||||
|
if (resource == null) {
|
||||||
|
throw new IllegalStateException("Jar does not contain jarinjar");
|
||||||
|
}
|
||||||
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener
|
@Listener
|
||||||
|
Loading…
Reference in New Issue
Block a user