on xenial help sign in
rootObject can be null for a small moment after setSource is called

Fixes: #1560501 Approved by: Daniel d'Andrada

commitbcfc279f714f54c5e77c6a220589fb4d2ea9870d authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 27 Apr 2016, 14:58 (10 years ago) parent77c227c3fe1956
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}