From e7db893c1f2f8bf168ab1481a4f7b6bfef310a56 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 29 Aug 2017 09:10:21 +0200 Subject: [PATCH] fixed: check for nullptr before dereferencing --- Apps/Common/MultiPatchModelGenerator.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Apps/Common/MultiPatchModelGenerator.C b/Apps/Common/MultiPatchModelGenerator.C index 8653e788..10748281 100644 --- a/Apps/Common/MultiPatchModelGenerator.C +++ b/Apps/Common/MultiPatchModelGenerator.C @@ -157,6 +157,7 @@ MultiPatchModelGenerator1D::MultiPatchModelGenerator1D (const TiXmlElement* geo) nx = 1; periodic_x = 0; subdivision = false; + if (!geo) return; utl::getAttribute(geo,"nx",nx); utl::getAttribute(geo,"subdivision",subdivision); utl::getAttribute(geo,"periodic_x", periodic_x); @@ -231,6 +232,7 @@ MultiPatchModelGenerator2D::MultiPatchModelGenerator2D (const TiXmlElement* geo) nx = ny = 1; periodic_x = periodic_y = 0; subdivision = false; + if (!geo) return; utl::getAttribute(geo,"nx",nx); utl::getAttribute(geo,"ny",ny); utl::getAttribute(geo,"subdivision",subdivision); @@ -539,6 +541,7 @@ MultiPatchModelGenerator3D::MultiPatchModelGenerator3D (const TiXmlElement* geo) nx = ny = nz = 1; periodic_x = periodic_y = periodic_z = 0; subdivision = false; + if (!geo) return; utl::getAttribute(geo,"nx",nx); utl::getAttribute(geo,"ny",ny); utl::getAttribute(geo,"nz",nz);