mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Prevent NPE in Data Manager
This commit is contained in:
parent
44e1b8f159
commit
4b87ac2907
@ -8,6 +8,7 @@ import com.volmit.iris.util.ResourceLoader;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -186,7 +187,7 @@ public class IrisDataManager
|
|||||||
public static <T extends IrisRegistrant> T loadAny(String key, Function<IrisDataManager, T> v) {
|
public static <T extends IrisRegistrant> T loadAny(String key, Function<IrisDataManager, T> v) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for(File i : Iris.instance.getDataFolder("packs").listFiles())
|
for(File i : Objects.requireNonNull(Iris.instance.getDataFolder("packs").listFiles()))
|
||||||
{
|
{
|
||||||
if(i.isDirectory())
|
if(i.isDirectory())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user