Core/Maps: Fixed crash caused by using invalid coordinates

Closes #12532