check Buffer validity
Summary:
if a plasma theme doesn't provide shadow graphics,
the buffer will be a nullptr as would be created
from an invalid image and would crash
BUG:381953
Test Plan: no crash anymore when using a theme that doesn't provide shadows
Reviewers: Plasma, davidedmundson
Reviewed By: Plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel, Frameworks
Tags: Plasma on Wayland, Frameworks
Differential Revision: https://phabricator.kde.org/D6523