Avoids some potential NullPointerExceptions related to dynmap integration
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit

This commit is contained in:
Kristian Knarvik 2022-06-24 03:33:49 +02:00
parent ce5f3ef52f
commit 524130c4e0

View File

@ -34,7 +34,9 @@ public final class DynmapManager {
portalIcon = null;
} else {
markerSet = dynmapAPI.getMarkerAPI().createMarkerSet("stargate", "Stargate", null, false);
markerSet.setHideByDefault(Stargate.getStargateConfig().hideDynmapIcons());
if (markerSet != null) {
markerSet.setHideByDefault(Stargate.getStargateConfig().hideDynmapIcons());
}
portalIcon = dynmapAPI.getMarkerAPI().getMarkerIcon("portal");
}
}
@ -99,7 +101,9 @@ public final class DynmapManager {
portal.getDestinationName(), portal.getOwner().getName());
marker.setDescription(markerDescription);
marker.setLabel(portal.getName(), true);
marker.setMarkerIcon(portalIcon);
if (portalIcon != null) {
marker.setMarkerIcon(portalIcon);
}
}
/**