From 0ebd3e6ca296427079c5ae34c77e7e9e6c12cba0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 19 Jul 2019 14:10:19 +0100 Subject: [PATCH] fix /effect crash --- src/pocketmine/command/defaults/EffectCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/command/defaults/EffectCommand.php b/src/pocketmine/command/defaults/EffectCommand.php index ef8a0c1b1..d78b5cc04 100644 --- a/src/pocketmine/command/defaults/EffectCommand.php +++ b/src/pocketmine/command/defaults/EffectCommand.php @@ -68,8 +68,9 @@ class EffectCommand extends VanillaCommand{ return true; } - $effect = VanillaEffects::fromString($args[1]); - if($effect === null){ + try{ + $effect = VanillaEffects::fromString($args[1]); + }catch(\InvalidArgumentException $e){ $sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [(string) $args[1]])); return true; }