Fixes a NullPointerException when deleting a space