Fix for issue #2171

Check for nil before attempting to dock with a starport.
Prevents crash reported in #2171 but is not really an ideal fix, more of a bandage.

Does anyone have a better solution?