Add null pointer check to getStopped

PackageSetting is not guaranteed to be non-null which caused test
failures. This adds a null check.

Bug: 184936704
Test: presubmit
Change-Id: Ie58ffa0d9abde5417e4db48389e526eaf43e0cf6
1 file changed