fix potential npe on service restart

Change-Id: I9ed1ebb6f9536d4faf544e5a60e8186913bde0f6