From e18501417d084a1decc07befcfc3b87bc6df2b81 Mon Sep 17 00:00:00 2001 From: Pepich Date: Sat, 18 Feb 2017 18:32:15 +0100 Subject: [PATCH] Fixed NPE when there's no lols defined --- src/com/redstoner/modules/saylol/Saylol.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/redstoner/modules/saylol/Saylol.java b/src/com/redstoner/modules/saylol/Saylol.java index e85ebc4..80640e9 100644 --- a/src/com/redstoner/modules/saylol/Saylol.java +++ b/src/com/redstoner/modules/saylol/Saylol.java @@ -15,7 +15,7 @@ import com.redstoner.misc.Main; import com.redstoner.misc.Utils; import com.redstoner.modules.Module; -@Version(major = 1, minor = 0, revision = 3, compatible = 1) +@Version(major = 1, minor = 0, revision = 4, compatible = 1) public class Saylol implements Module { private long lastLol = 0; @@ -123,6 +123,11 @@ public class Saylol implements Module @Command(hook = "saylol") public boolean saylol(CommandSender sender) { + if (lols.size() == 0) + { + Utils.sendErrorMessage(sender, null, "There are no lols yet!"); + return true; + } long time = System.currentTimeMillis(); if (time - lastLol < 15000) {