Prevent NPE when resolving network connection

Give up attempting to resolve the network connection if the activity
reference is null

Change-Id: Ifced19fea31fdaff1a4df510b68bdb58d4356fdc