Commit on behalf of Manish
Add null check as sg_ can be NULL if SecurityGroupEntry::Activate() is
not called.

Change-Id: Ic40815d36425ee4524cfd06d2a99ae04e6caa0f6
Closes-bug: 1398885