From 40e1e4e726a6055972cdb4976b863f308a253866 Mon Sep 17 00:00:00 2001 From: Sader Fawall Date: Mon, 20 Jul 2020 23:04:35 +0200 Subject: [PATCH] Fixes crash when warping to invalid instance (#5228) Thanks to @sader1992! --- src/map/instance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/instance.cpp b/src/map/instance.cpp index 5122faa1d3..dcbd4f098c 100644 --- a/src/map/instance.cpp +++ b/src/map/instance.cpp @@ -980,7 +980,8 @@ e_instance_enter instance_enter(struct map_session_data *sd, int instance_id, co if (instance_id <= 0) // Default party checks will be used mode = IM_PARTY; else { - idata = util::umap_find(instances, instance_id); + if (!(idata = util::umap_find(instances, instance_id))) + return IE_NOINSTANCE; mode = idata->mode; }