Fixed: NullPointerException

This commit is contained in:
Reider745
2025-05-14 10:04:48 +03:00
parent 0db0b06574
commit df95223e93
2 changed files with 5 additions and 3 deletions
@@ -352,7 +352,7 @@ public class InnerCoreServer {
BehaviorPack pack = new BehaviorPack(file.getAbsolutePath()); BehaviorPack pack = new BehaviorPack(file.getAbsolutePath());
pack.load(); pack.load();
}catch (Exception e) { }catch (Exception e) {
Logger.error("Error loaded behavior pack " + file.getAbsolutePath()); Logger.error("Error loaded behavior pack " + file.getAbsolutePath(), e);
} }
} }
}catch (Exception ignore){} }catch (Exception ignore){}
@@ -83,8 +83,10 @@ public class BehaviorPack {
for(BehaviorContent content : contents_api){ for(BehaviorContent content : contents_api){
final String pathFolder = this.path + content.getDefaultDirectory(); final String pathFolder = this.path + content.getDefaultDirectory();
final String[] files = new File(pathFolder).list(); final String[] files = new File(pathFolder).list();
for(String file : files) if(files != null) {
loadFileContext(pathFolder+"/"+file); for (String file : files)
loadFileContext(pathFolder + "/" + file);
}
} }
} }