From 98cee78b7818c8ff0e11bd20f747004327ed2603 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 14 Feb 2005 17:51:57 +0000 Subject: [PATCH] assert on invalid enum strings early --- stepmania/src/ScreenOptionsMaster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index bda835a51a..0e21d8b2b1 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -137,6 +137,7 @@ void ScreenOptionsMaster::SetLua( OptionRowDefinition &row, OptionRowHandler &ha if( pStr == NULL ) RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string", sLuaFunction.c_str() ); row.layoutType = StringToLayoutType( pStr ); + ASSERT( row.layoutType != LAYOUT_INVALID ); lua_pop( LUA->L, 1 ); lua_pushstring( LUA->L, "SelectType" ); @@ -145,6 +146,7 @@ void ScreenOptionsMaster::SetLua( OptionRowDefinition &row, OptionRowHandler &ha if( pStr == NULL ) RageException::Throw( "\"%s\" \"SelectType\" entry is not a string", sLuaFunction.c_str() ); row.selectType = StringToSelectType( pStr ); + ASSERT( row.selectType != SELECT_INVALID ); lua_pop( LUA->L, 1 ); /* Iterate over the "Choices" table. */