Some null safety (fixes #24)
This commit is contained in:
parent
2225ad73ce
commit
5077197fe0
|
@ -45,8 +45,12 @@ public class ResourcePackManagerMixin {
|
|||
private void rpo$checkProfile(String profileName, String displayName, ResourcePack rpi, Set<Path> toRemove) {
|
||||
Path dataLocation = null;
|
||||
if (rpi instanceof AbstractFileResourcePack arr) {
|
||||
Path pack = arr.getBase().toPath();
|
||||
dataLocation = pack.getParent().resolve(pack.getFileName().toString() + Respackopts.FILE_EXTENSION);
|
||||
File pack = arr.getBase();
|
||||
if (pack != null) {
|
||||
dataLocation = pack.toPath().getParent().resolve(pack.getName() + Respackopts.FILE_EXTENSION);
|
||||
} else {
|
||||
Respackopts.LOGGER.warn("Base path of abstract file resource pack " + arr.getName() + " is null. This shouldn't happen!");
|
||||
}
|
||||
}
|
||||
|
||||
try (InputStream is = rpi.openRoot(Respackopts.ID + ".json5")) {
|
||||
|
|
Loading…
Reference in New Issue