From ba0a8dabeff92ecd87d28b4b5b4010e958be5851 Mon Sep 17 00:00:00 2001 From: zeuner Date: Fri, 17 Mar 2017 21:28:43 +0100 Subject: [PATCH] avoid crashing when accessing mapgen early (#5384) --- src/emerge.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/emerge.cpp b/src/emerge.cpp index 8719a9eb3..a3efb09e7 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -174,6 +174,9 @@ bool EmergeManager::initMapgens(MapgenParams *params) Mapgen *EmergeManager::getCurrentMapgen() { + if (!m_threads_active) + return NULL; + for (u32 i = 0; i != m_threads.size(); i++) { if (m_threads[i]->isCurrentThread()) return m_threads[i]->m_mapgen; -- 2.25.1