From c00fee82da638e09ff902fe13ae703531ac7ed99 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Tue, 10 Sep 2019 22:14:33 +0200
Subject: [PATCH] [App/IO] Avoid accidental nullptr access.

---
 Applications/FileIO/GMSInterface.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Applications/FileIO/GMSInterface.cpp b/Applications/FileIO/GMSInterface.cpp
index 925e851c385..3a2f58c9ae8 100644
--- a/Applications/FileIO/GMSInterface.cpp
+++ b/Applications/FileIO/GMSInterface.cpp
@@ -75,6 +75,8 @@ int GMSInterface::readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes,
                 // later on!
                 if (pnt[2] != depth)
                 {
+                    if (newBorehole == nullptr)
+                        OGS_FATAL("Trying to access a nullptr.");
                     newBorehole->addSoilLayer(
                         pnt[0], pnt[1], pnt[2], sName);
                     sName = (*(++it));
-- 
GitLab