diff src/mex.cc @ 6347:e40a46a100b6

[project @ 2007-02-23 00:28:58 by jwe]
author jwe
date Fri, 23 Feb 2007 00:28:58 +0000
parents ec88b4ab6d10
children 566343604d95
line wrap: on
line diff
--- a/src/mex.cc
+++ b/src/mex.cc
@@ -1839,7 +1839,10 @@
     int nel = get_number_of_elements ();
 
     for (int i = 0; i < nel * nfields; i++)
-      data[i] = val.data[i]->clone ();
+      {
+	mxArray *ptr = val.data[i];
+	data[i] = ptr ? ptr->clone () : 0;
+      }
   }
 };
 
@@ -1913,7 +1916,10 @@
     int nel = get_number_of_elements ();
 
     for (int i = 0; i < nel; i++)
-      data[i] = val.data[i]->clone ();
+      {
+	mxArray *ptr = val.data[i];
+	data[i] = ptr ? ptr->clone () : 0;
+      }
   }
 };