on xenial help sign in
rootObject can be null for a small moment after setSource is called
commit3fe19565c7ae938a35304bfe2ab4b4c435649e01 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 22 Mar 2016, 15:09 (11 years ago) parent2d6f528
1 file changed+6−2
src/ShellView.cpp+6−2
src/ShellView.cpp+6−2
@@ -49,11 +49,15 @@ void ShellView::onWidthChanged(int w)
4949 // The QResizeEvent we get still has the size of the first screen and since the resize move is triggered
5050 // from the resize event handler, the root item doesn't get resized.
5151 // TODO: Confirm the Qt bug and submit a patch upstream
52− rootObject()->setWidth(w);
52+ if (rootObject()) {
53+ rootObject()->setWidth(w);
54+ }
5355}
5456
5557void ShellView::onHeightChanged(int h)
5658{
5759 // See comment in ShellView::onWidthChanged()
58− rootObject()->setHeight(h);
60+ if (rootObject()) {
61+ rootObject()->setHeight(h);
62+ }
5963}