the package about to be deleted or upgraded when updating permissions associated with the shared user. Include a simple null check when retrieving the permission. Fix PackageParser to avoid ArrayIndexOutOfBounds exceptions in several places