← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1750343-priorities-barracks into lp:widelands

 

Notabilis has proposed merging lp:~widelands-dev/widelands/bug-1750343-priorities-barracks into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1750343 in widelands: "Crash when ctrl-clicking ware priority buttons for barracks"
  https://bugs.launchpad.net/widelands/+bug/1750343

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1750343-priorities-barracks/+merge/337939

Fixing bug 1750343: When doing a Ctrl+Click on a priority button and the building also has a worker queue, the game crashes. Problem was a missing check whether the priority button of the queue exists before modifying it.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1750343-priorities-barracks into lp:widelands.
=== modified file 'src/wui/inputqueuedisplay.cc'
--- src/wui/inputqueuedisplay.cc	2017-12-18 10:45:01 +0000
+++ src/wui/inputqueuedisplay.cc	2018-02-19 11:15:52 +0000
@@ -308,6 +308,11 @@
 			// Cast failed. Sibling is no InputQueueDisplay
 			continue;
 		}
+		if (display->type_ != Widelands::wwWARE) {
+			// No ware, so there is no radio group
+			continue;
+		}
+		assert(display->priority_radiogroup_ != nullptr);
 		if (display->priority_radiogroup_->get_state() == state) {
 			// Nothing to do for this queue
 			continue;


Follow ups