Browse Source

Fix potential crash on exit

Ivan Savenko 2 years ago
parent
commit
c246cadaa7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      client/windows/CCastleInterface.cpp

+ 2 - 1
client/windows/CCastleInterface.cpp

@@ -1210,7 +1210,8 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
 
 CCastleInterface::~CCastleInterface()
 {
-	adventureInt->onAudioResumed();
+	if (adventureInt) // may happen on exiting client with open castle interface
+		adventureInt->onAudioResumed();
 	if(LOCPLINT->castleInt == this)
 		LOCPLINT->castleInt = nullptr;
 }