From b3a6e796f93cde82867d6030006c1382cb56091a Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 8 Oct 2021 14:25:37 +0100 Subject: [PATCH] Fix potential nullptr dereference in Slider::ScopedDragNotification destructor --- modules/juce_gui_basics/widgets/juce_Slider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp index 637e2d60df..5062d5ed7a 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.cpp +++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp @@ -1363,7 +1363,8 @@ Slider::ScopedDragNotification::ScopedDragNotification (Slider& s) Slider::ScopedDragNotification::~ScopedDragNotification() { - sliderBeingDragged.pimpl->sendDragEnd(); + if (sliderBeingDragged.pimpl != nullptr) + sliderBeingDragged.pimpl->sendDragEnd(); } //==============================================================================