From 4e2d12bf5840d04ad4ec1a9da0e6787c84bda787 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 21 Sep 2012 05:44:35 +0000
Subject: [PATCH]

---
 Geo/MElement.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index eb8341bab3..0445779c8b 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -1411,7 +1411,7 @@ MElement *MElementFactory::create(int num, int type, const std::vector<int> &tag
   if(tags.size() > 2 && (type == MSH_PNT_SUB || type == MSH_LIN_SUB ||
                          type == MSH_TRI_SUB || type == MSH_TET_SUB)){
     parent = elementCache[tags[1]];
-    if(tags[2]){ // num partitions
+    if(tags.size() > 3 && tags[2]){ // num partitions
       part = tags[3];
       for(int i = 0; i < tags[2] - 1; i++)
         ghosts.push_back(tags[4 + i]);
-- 
GitLab