Skip to content

Commit 8c3ec4c

Browse files
committed
fix: Prevent crash if an INI data field is not found for debug builds
1 parent cfb0667 commit 8c3ec4c

File tree

2 files changed

+6
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/Common/INI
  • Generals/Code/GameEngine/Source/Common/INI

2 files changed

+6
-0
lines changed

Generals/Code/GameEngine/Source/Common/INI/INI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,10 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList
15281528
{
15291529
DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'",
15301530
INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) );
1531+
#if !defined(RTS_DEBUG)
1532+
// Just ignore unknown fields in debug builds
15311533
throw INI_UNKNOWN_TOKEN;
1534+
#endif
15321535
}
15331536

15341537
} // end else

GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,10 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList
15301530
{
15311531
DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'",
15321532
INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) );
1533+
#if !defined(RTS_DEBUG)
1534+
// Just ignore unknown fields in debug builds
15331535
throw INI_UNKNOWN_TOKEN;
1536+
#endif
15341537
}
15351538

15361539
} // end else

0 commit comments

Comments
 (0)