From 02e54b16f7c8d47d892a3575f6da4be6e4110154 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 25 Oct 2013 16:18:49 +0000
Subject: [PATCH] fix crash

---
 Geo/Geo.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index 21b92b5123..37fa99c378 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -2093,9 +2093,9 @@ void BoundaryShapes(List_T *shapes, List_T *shapesBoundary, bool combined)
 // Added by Trevor Strickler for extruding unique compound surface edges
 static List_T* GetCompoundUniqueEdges(Surface *ps)
 {
-
   // Two parts:
-  // Part 1: create map of keys with values abs(c->Num) that map to integer counts of abs(c->num) in compound
+  // Part 1: create map of keys with values abs(c->Num) that map to integer
+  //   counts of abs(c->num) in compound
   // Part 2: Make the unique list
 
   std::vector<int> comp_surfs = ps->compound;
@@ -2198,6 +2198,9 @@ static List_T* GetOrderedUniqueEdges( Surface *s )
   // these into the gmsh geometry system.
   // Have to get list of surface numbers
   int numgen = List_Nbr(unique);
+
+  if(!numgen) return 0;
+
   List_T *gen_nums = List_Create(numgen, 1, sizeof(int));
 
   for( int i = 0; i < numgen; i++ ){
-- 
GitLab