(svn r12927) [NoAI] -Fix: don't crash on the GUI when an AI failed to compile and you still manual it (bug by glx)
--- a/src/ai/ai_gui.cpp Tue Apr 29 21:49:14 2008 +0000
+++ b/src/ai/ai_gui.cpp Tue Apr 29 22:02:38 2008 +0000
@@ -115,7 +115,12 @@
}
AIFactoryBase *factory = AI_GetPlayerFactory(_ai_debug_player);
- DoDrawString(factory->GetAIName(), 7, 34, TC_BLACK);
+ if (factory == NULL) {
+ DoDrawString("(unknown)", 7, 34, TC_BLACK);
+ w->DisableWidget(AID_WIDGET_RELOAD_TOGGLE);
+ } else {
+ DoDrawString(factory->GetAIName(), 7, 34, TC_BLACK);
+ }
PlayerID old_cp = _current_player;
_current_player = _ai_debug_player;