[commit] r2479 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu May 1 16:50:17 CDT 2014


Author: ksmyth
Date: Thu May  1 16:50:17 2014
New Revision: 2479

Log:
Dont crash if refport is added to null reference

Modified:
   trunk/GME/Mga/MgaConnection.cpp

Modified: trunk/GME/Mga/MgaConnection.cpp
==============================================================================
--- trunk/GME/Mga/MgaConnection.cpp	Thu May  1 11:30:32 2014	(r2478)
+++ trunk/GME/Mga/MgaConnection.cpp	Thu May  1 16:50:17 2014	(r2479)
@@ -200,6 +200,8 @@
 	{
 		CoreObj last_ref = (*peers)[peercnt - 3];
 		CoreObj tgt_model= last_ref[ATTRID_REFERENCE];
+		if (!last_ref.p)
+			throw_com_error(E_MGA_INVALID_ARG, L"Cannot add refport to null reference");
 		CoreObj tgt_elem = (*peers)[peercnt - 2];
 		CoreObj parent   = tgt_elem[ATTRID_FCOPARENT];
 		CoreObj bas_model= tgt_model[ATTRID_DERIVED]; // tgt_model must be a derived for GetDerivedEquivalent to succeed


More information about the gme-commit mailing list