Merge lp:~widelands-dev/widelands/bug_1794339_center_wo_parent into lp:widelands
Proposed by
Klaus Halfmann
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~widelands-dev/widelands/bug_1794339_center_wo_parent | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
26 lines (+9/-5) 1 file modified
src/ui_basic/window.cc (+9/-5) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug_1794339_center_wo_parent | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+355873@code.launchpad.net |
This proposal has been superseded by a proposal from 2018-09-30.
Commit message
Avoid null access in Window:
Description of the change
Simple check if Window has a parent instead of crashing.
This leaves the window in the top-lfet corner, but avoids the crash.
Gun: can we center to some global window instead.
To post a comment you must log in.
No, we can't center to a global parent, because the direct parent is already nullptr.
I am wondering whether this fix doesn't just mask the real bug - it would be interesting to track down why that particular window has no parent. There's something wrong with the control flow there.