diff --git a/multiworld-bukkit/src/main/java/com/dev7ex/multiworld/listener/entity/EntityPortalListener.java b/multiworld-bukkit/src/main/java/com/dev7ex/multiworld/listener/entity/EntityPortalListener.java index 14ce4d3..7e05069 100644 --- a/multiworld-bukkit/src/main/java/com/dev7ex/multiworld/listener/entity/EntityPortalListener.java +++ b/multiworld-bukkit/src/main/java/com/dev7ex/multiworld/listener/entity/EntityPortalListener.java @@ -40,7 +40,13 @@ public void handleEntityEnterPortal(final EntityPortalEvent event) { if (event.getFrom().getWorld() == null) { return; } - final BukkitWorldHolder fromWorldHolder = super.getWorldProvider().getWorldHolder(event.getFrom().getWorld().getName()).orElseThrow(); + + if (super.getWorldProvider().getWorldHolder(event.getFrom().getWorld().getName()).isEmpty()) { + return; + } + final BukkitWorldHolder fromWorldHolder = super.getWorldProvider() + .getWorldHolder(event.getFrom().getWorld().getName()) + .get(); if ((event.getTo() == null) || (event.getTo().getWorld() == null)) { return;