You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functions GetErrorStr1 and GetErrorStr2 call GetStr() on a member variable that is a StrPair. If this member variable last operation had been a reset (which is the case most of the time) then call GetStr() will cause the code to throw an assertion. This throw will cause most applications to crash since there is no code to catch that exception. I would suggest the follow changes to those two routines:
The functions GetErrorStr1 and GetErrorStr2 call GetStr() on a member variable that is a StrPair. If this member variable last operation had been a reset (which is the case most of the time) then call GetStr() will cause the code to throw an assertion. This throw will cause most applications to crash since there is no code to catch that exception. I would suggest the follow changes to those two routines:
const char* XMLDocument::GetErrorStr1() const
{
if (_errorStr1.Empty())
{
return NULL;
}
}
const char* XMLDocument::GetErrorStr2() const
{
if (_errorStr2.Empty())
{
return NULL;
}
}
This is a simple addition of an "if statement" to check to see if the StrPair is empty and if so return a NULL;
Thanks
Larry
The text was updated successfully, but these errors were encountered: