Stop a NullPointerException when passing a non-existent rank