[reSIProcate] DUM: should use DialogSet::getUserProfile() accessor, not naked mUserProfile member variable

John Gregg jgregg at aylus.com
Mon Jun 16 10:03:42 CDT 2014


In Dialog.cxx, DialogUsageManager.cxx, ClientRegistration.cxx, 
NonDialogUsage.cxx, and once in DialogSet.cxx itself, code accesses the 
mUserProfile as-is:

if(mDialogSet.mUserProfile->hasUserAgentCapabilities())
                   {
                      mLocalContact = 
mDialogSet.mUserProfile->getUserAgentCapabilities();
                   }

This will crash if no one has ever set mDialogSet.mUserProfile using 
setUserProfile(). Shouldn't everyone just use the accessor, 
getUserProfile(), which protects against this kind of thing?

if(mDialogSet.getUserProfile()->hasUserAgentCapabilities())
                   {
                      mLocalContact = 
mDialogSet.getUserProfile()->getUserAgentCapabilities();
                   }

I'm not including diff files, since this is a largely self-explanatory 
mechanical search and replace operation, and the diffs would just be a 
jumble. I'm looking at 1.9.6.

-John Gregg




More information about the resiprocate-devel mailing list