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.