Add null checks for command permissions