From 4ac86c4e3022fced604f0772a10ab442cb776873 Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 17 Aug 2012 15:12:54 +0800 Subject: [PATCH] Null checks when searching for Vault --- src/main/java/net/citizensnpcs/Citizens.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/Citizens.java b/src/main/java/net/citizensnpcs/Citizens.java index 0d7e831f4..4508ed096 100644 --- a/src/main/java/net/citizensnpcs/Citizens.java +++ b/src/main/java/net/citizensnpcs/Citizens.java @@ -203,8 +203,10 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { try { RegisteredServiceProvider provider = Bukkit.getServicesManager().getRegistration( Economy.class); - Economy economy = provider.getProvider(); - Bukkit.getPluginManager().registerEvents(new NPCPayListener(economy), this); + if (provider != null && provider.getProvider() != null) { + Economy economy = provider.getProvider(); + Bukkit.getPluginManager().registerEvents(new NPCPayListener(economy), this); + } } catch (NoClassDefFoundError e) { Messaging.log("Unable to use economy handling. Has Vault been enabled?"); }