Tries to fix a stack trace when Dynmap fails to disable itself
This commit is contained in:
		@@ -27,8 +27,9 @@ public final class DynmapManager {
 | 
				
			|||||||
     * Initializes the dynmap manager
 | 
					     * Initializes the dynmap manager
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param dynmapAPI <p>A reference</p>
 | 
					     * @param dynmapAPI <p>A reference</p>
 | 
				
			||||||
 | 
					     * @throws NullPointerException <p>If dynmap has an invalid state</p>
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void initialize(DynmapAPI dynmapAPI) {
 | 
					    public static void initialize(DynmapAPI dynmapAPI) throws NullPointerException {
 | 
				
			||||||
        if (dynmapAPI == null || dynmapAPI.getMarkerAPI() == null) {
 | 
					        if (dynmapAPI == null || dynmapAPI.getMarkerAPI() == null) {
 | 
				
			||||||
            markerSet = null;
 | 
					            markerSet = null;
 | 
				
			||||||
            portalIcon = null;
 | 
					            portalIcon = null;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -108,8 +108,13 @@ public final class StargateConfig {
 | 
				
			|||||||
        setupVaultEconomy();
 | 
					        setupVaultEconomy();
 | 
				
			||||||
        DynmapAPI dynmapAPI = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
 | 
					        DynmapAPI dynmapAPI = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
 | 
				
			||||||
        if (dynmapAPI != null) {
 | 
					        if (dynmapAPI != null) {
 | 
				
			||||||
            DynmapManager.initialize(dynmapAPI);
 | 
					            try {
 | 
				
			||||||
            DynmapManager.addAllPortalMarkers();
 | 
					                DynmapManager.initialize(dynmapAPI);
 | 
				
			||||||
 | 
					                DynmapManager.addAllPortalMarkers();
 | 
				
			||||||
 | 
					            } catch (NullPointerException exception) {
 | 
				
			||||||
 | 
					                logger.warning("Dynmap started in an invalid state. Check your log/console for dynmap-related " +
 | 
				
			||||||
 | 
					                        "problems. Dynmap integration cannot be initialized.");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.isLoaded = true;
 | 
					        this.isLoaded = true;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user