Prevent "TypeError: Cannot read property 'Layout' of null" warning on plasmashell startup
ClosedPublic

Authored by eliasp on Sep 24 2016, 8:03 AM.

Details

Summary

When starting plasmashell, the following warning was displayed:

file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Panel.qml:83: TypeError: Cannot read property 'Layout' of null

This adds a check whether the containment is available before attempting to use its layout.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
eliasp updated this revision to Diff 6901.Sep 24 2016, 8:03 AM
eliasp retitled this revision from to Prevent "TypeError: Cannot read property 'Layout' of null" warning on plasmashell startup.
eliasp updated this object.
eliasp edited the test plan for this revision. (Show Details)
eliasp added a reviewer: Plasma.
eliasp set the repository for this revision to R119 Plasma Desktop.
eliasp added a project: Plasma.
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptSep 24 2016, 8:03 AM
davidedmundson added inline comments.
desktoppackage/contents/views/Panel.qml
78

in theory, this line should be doing that.

Any idea why it isn't?

eliasp added inline comments.Sep 24 2016, 11:15 AM
desktoppackage/contents/views/Panel.qml
78

Unfortunately - no idea why it doesn't prevent that.

davidedmundson accepted this revision.Sep 24 2016, 11:33 AM
davidedmundson added a reviewer: davidedmundson.

Me neither :(

This revision is now accepted and ready to land.Sep 24 2016, 11:33 AM
This revision was automatically updated to reflect the committed changes.
broulik added inline comments.
desktoppackage/contents/views/Panel.qml
79

The binding is still evaluated and a value assigned to "value", it's just that Binding {} won't propagate it to its target when "when" doesn't evaluate true.