Skip to content

Commit f056356

Browse files
authored
fix ignore nulls
1 parent c3a4edb commit f056356

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/mods/Hileb/shotaasm/impl/ShotaScriptLocator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package mods.Hileb.shotaasm.impl;
22

3+
import mods.Hileb.shotaasm.ShotaASM;
34
import mods.Hileb.shotaasm.ScriptLoader;
45
import mods.Hileb.shotaasm.api.IScriptLocator;
56
import mods.Hileb.shotaasm.api.ScriptFile;
@@ -29,6 +30,10 @@ public Collection<ScriptFile> getScripts() {
2930
try {
3031
String name = file.getName();
3132
ScriptFile scriptFile = ScriptFile.create(name, new String(IOUtils.toByteArray(Files.newBufferedReader(file.toPath()), StandardCharsets.UTF_8)));
33+
if (scriptFile == null) {
34+
ShotaASM.LOGGER.error("error when locate script for {}", file.getAbsolutePath());
35+
continue;
36+
}
3237
scriptFile.data().put("file", file);
3338
list.add(scriptFile);
3439
} catch (IOException e) {

0 commit comments

Comments
 (0)