Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 7241)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 7242)
@@ -695,13 +695,18 @@
 /*FUNCTION Tria::CreateKMatrixDiagnosticMacAyeal {{{1*/
 ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyeal(void){
-	
+
+	ElementMatrix* Ke=NULL;
+
 	/*compute all stiffness matrices for this element*/
 	ElementMatrix* Ke1=CreateKMatrixDiagnosticMacAyealViscous();
 	ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyealFriction();
-	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
-
-	/*clean-up and return*/
-	delete Ke1;
-	delete Ke2;
+	
+	if(Ke1 || Ke2){
+		 Ke=new ElementMatrix(Ke1,Ke2);
+
+		/*clean-up and return*/
+		delete Ke1;
+		delete Ke2;
+	}
 	return Ke;
 
