From aef7e7ef37656052932cc9a4c3cf5429d38ff862 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 30 Nov 2019 15:05:58 +0100 Subject: [PATCH] fixed potential crash in get_umap --- nonisotropic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 18b85c2c..7add7010 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1115,7 +1115,7 @@ EX namespace hybrid { } } - EX hrmap* get_umap() { return ((hrmap_hybrid*)currentmap)->underlying_map; } + EX hrmap* get_umap() { if(!dynamic_cast(currentmap)) return nullptr; else return ((hrmap_hybrid*)currentmap)->underlying_map; } #if HDR template auto in_underlying_geometry(const T& f) -> decltype(f()) {