message: Check if the virtual machine is available before attempting to create a script context.
diff: @@ -135,17 +135,16 @@ static void RegisterHandlers(AllHandlers* handlers, unsigned size)
  MessageBus::Subscribe("NWNX_CORE_SIGNAL",
  [](const std::vector<std::string>& message)
  {
  - // We will crash the server if we try to create a script context after the server is destroyed.
  - if (message[0] == "ON_DESTROY_SERVER_AFTER")
  + if (API::Globals::VirtualMachine())
  {
  + int spBefore = Utils::PushScriptContext(Constants::OBJECT_INVALID, 0, false);
  s_handlers.SignalHandler(message[0].c_str());
  + int spAfter = Utils::PopScriptContext();
  + ASSERT_MSG(spBefore == spAfter, "spBefore=%x, spAfter=%x", spBefore, spAfter);
  }
  else
  {
  - int spBefore = Utils::PushScriptContext(Constants::OBJECT_INVALID, 0, false);
  s_handlers.SignalHandler(message[0].c_str());
  - int spAfter = Utils::PopScriptContext();
  - ASSERT_MSG(spBefore == spAfter, "spBefore=%x, spAfter=%x", spBefore, spAfter);
  }
  });
  }
  