From c8bb5e6fce8c95cd2a15e316bef30e344b1a079c Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sun, 1 May 2011 22:28:42 +0000 Subject: [PATCH] bugfix for crash ( when no unit is selected and display text is calculated ) --- source/glest_game/gui/gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index f6c7a440a..16687e9cb 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -615,7 +615,7 @@ string Gui::computeDefaultInfoString(){ string result=""; - if(selection.isCommandable() && selection.isUniform()){ + if((!selection.isEmpty()) && selection.isCommandable() && selection.isUniform()){ // default is the description extension result=selection.getFrontUnit()->getDescExtension(); } @@ -631,7 +631,7 @@ void Gui::computeInfoString(int posDisplay){ display.setInfoText(computeDefaultInfoString()); - if(posDisplay!=invalidPos && selection.isCommandable()){ + if((!selection.isEmpty()) && posDisplay!=invalidPos && selection.isCommandable()){ if(!selectingBuilding){ if(posDisplay==cancelPos){ display.setInfoText(lang.get("Cancel"));