diff --git a/src/Network/multiplay.cxx b/src/Network/multiplay.cxx index d9eb5ea37..a55de0ead 100644 --- a/src/Network/multiplay.cxx +++ b/src/Network/multiplay.cxx @@ -219,13 +219,19 @@ bool FGMultiplay::process() { ******************************************************************/ bool FGMultiplay::close() { + FGMultiplayMgr *mgr = globals->get_multiplayer_mgr(); + + if (mgr == 0) { + return false; + } + if (get_direction() == SG_IO_IN) { - globals->get_multiplayer_mgr()->Close(); + mgr->Close(); } else if (get_direction() == SG_IO_OUT) { - globals->get_multiplayer_mgr()->Close(); + mgr->Close(); }