Skip to content

Commit

Permalink
Fix NPE during migration with network of name length 13
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorinwasher committed Jun 19, 2024
1 parent 4a6f328 commit 6ab291f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ private LegacyPortalStorageLoader() {
continue;
}
try {
portals.add(readPortal(line, world, stargateAPI, defaultNetworkName));
Portal portal = readPortal(line, world, stargateAPI, defaultNetworkName);
if(portal != null) {
portals.add(portal);
} else {
String[] portalProperties = line.split(":");
invalidPortals.add(new GlobalPortalId(portalProperties[0], (portalProperties.length > 9) ? portalProperties[9] : StargateConstant.DEFAULT_NETWORK_ID));
}
} catch (InvalidStructureException e) {
String[] portalProperties = line.split(":");
invalidPortals.add(new GlobalPortalId(portalProperties[0], (portalProperties.length > 9) ? portalProperties[9] : StargateConstant.DEFAULT_NETWORK_ID) );
Expand All @@ -97,7 +103,7 @@ private LegacyPortalStorageLoader() {
stringBuilder.append(globalPortalId.toString());
});
stringBuilder.append("\n\n");
stringBuilder.append("This has most likely been caused by an invalid or absent gate format");
stringBuilder.append("This has most likely been caused by an invalid or absent gate format or an invalid network name");
Stargate.log(Level.WARNING, stringBuilder.toString());
}
}
Expand Down

0 comments on commit 6ab291f

Please sign in to comment.