diff --git a/Utils.h b/Utils.h index 9f9c22ae..28f302df 100644 --- a/Utils.h +++ b/Utils.h @@ -502,6 +502,11 @@ public: CSmartPtr& operator =(const CSmartPtr& CopyFrom) { if (&CopyFrom != this) { // Check for assignment to self Release(); // Release the current pointer + + if (CopyFrom.IsNull()) { // If the source raw pointer is null + return *this; // Then just bail out + } + m_pType = &(*CopyFrom); // Make our pointers reference the same raw pointer and counter m_puCount = CopyFrom.GetCount();