Fixed an NPE when getting an app id.

If an app had no manifest, we tried to access it anyway.