Author: cazfi
Date: Thu Oct 22 18:13:48 2015
New Revision: 30170

URL: http://svn.gna.org/viewcvs/freeciv?rev=30170&view=rev
Log:
Crashed ruledit crash when requesting edit dialog without any unit type being 
selected.

See bug #23952

Modified:
    trunk/tools/ruledit/tab_unit.cpp

Modified: trunk/tools/ruledit/tab_unit.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruledit/tab_unit.cpp?rev=30170&r1=30169&r2=30170&view=diff
==============================================================================
--- trunk/tools/ruledit/tab_unit.cpp    (original)
+++ trunk/tools/ruledit/tab_unit.cpp    Thu Oct 22 18:13:48 2015
@@ -187,9 +187,11 @@
 **************************************************************************/
 void tab_unit::edit_now()
 {
-  edit_utype *edit = new edit_utype(ui, selected);
-
-  edit->show();
+  if (selected != nullptr) {
+    edit_utype *edit = new edit_utype(ui, selected);
+
+    edit->show();
+  }
 }
 
 /**************************************************************************


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to