Fixed a NullPointerException

If the server runs without a map, the console throwed a NullPointerException.
it was becuase the type was null, just added a check if the type is null or not.