diff --git a/src/renderer/widgets/Image.cpp b/src/renderer/widgets/Image.cpp index f2d475f..f5d1412 100644 --- a/src/renderer/widgets/Image.cpp +++ b/src/renderer/widgets/Image.cpp @@ -5,8 +5,10 @@ #include CImage::~CImage() { - imageTimer->cancel(); - imageTimer.reset(); + if (imageTimer) { + imageTimer->cancel(); + imageTimer.reset(); + } } static void onTimer(std::shared_ptr self, void* data) { diff --git a/src/renderer/widgets/Label.cpp b/src/renderer/widgets/Label.cpp index 11cf82d..79665b9 100644 --- a/src/renderer/widgets/Label.cpp +++ b/src/renderer/widgets/Label.cpp @@ -6,8 +6,10 @@ #include "../../core/hyprlock.hpp" CLabel::~CLabel() { - labelTimer->cancel(); - labelTimer.reset(); + if (labelTimer) { + labelTimer->cancel(); + labelTimer.reset(); + } } static void onTimer(std::shared_ptr self, void* data) {