< Previous by Date Date Index Next by Date >
  Thread Index  

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



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