Fix NPE bug in getPermissionRule

EV-513

The getPermissionRule method checks that the status is not null before
using it.