1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-29 02:40:05 +00:00

ModalCallbackFunction: Use NullCheckedInvocation helper to fix potential crash due to calling null std::function

This commit is contained in:
ed 2021-07-22 15:44:39 +01:00
parent a62f0f91d6
commit 88d2edf189

View file

@ -176,7 +176,7 @@ public:
struct Callable : public ModalComponentManager::Callback
{
explicit Callable (CallbackFn&& f) : fn (std::forward<CallbackFn> (f)) {}
void modalStateFinished (int result) override { fn (result); }
void modalStateFinished (int result) override { NullCheckedInvocation::invoke (std::move (fn), result); }
std::remove_reference_t<CallbackFn> fn;
};