Fixes NPE on null pkg

This change moves unprotected access of a setting's pkg field to take
place after an existing null check.

Test: atest AppEnumerationTests
Fixes: 157298411
Change-Id: I49c0cb0d08dd09cabd271cf195a8eff71a98083c
1 file changed