If the prisoners jail is null, then set it to the nearest one and
teleport them there. This should prevent some of the errors.