Fix NPE if type is null. (#195)

* Fix NPE if type is null.

Signed-off-by: ZekerZhayard <[email protected]>

* Forge does not support Java 18 for now.

Signed-off-by: ZekerZhayard <[email protected]>
This commit is contained in:
ZekerZhayard authored and GitHub committed 2021-11-28 02:17:38 +08:00
1 parent c8fb6e216e
commit cff5846e7f
5 files changed
+60 -41

No files matched your search

@@ -115,6 +115,10 @@ public class CustomSkinLoader {
for(int i=0;i<config.loadlist.size();i++){
SkinSiteProfile ssp=config.loadlist.get(i);
logger.info((i+1)+"/"+config.loadlist.size()+" Try to load profile from '"+ssp.name+"'.");
if(ssp.type==null){
logger.info("The type of '" + ssp.name + "' is null.");
continue;
}
ProfileLoader.IProfileLoader loader=ProfileLoader.LOADERS.get(ssp.type.toLowerCase());
if(loader==null){
logger.info("Type '"+ssp.type+"' is not defined.");