diff --git a/bindings/gumjs/gumquickeventsink.c b/bindings/gumjs/gumquickeventsink.c index ee18ac1d2..3fba7d9dc 100644 --- a/bindings/gumjs/gumquickeventsink.c +++ b/bindings/gumjs/gumquickeventsink.c @@ -1,5 +1,7 @@ /* - * Copyright (C) 2020 Ole André Vadla Ravnås + * Copyright (C) 2020-2024 Ole André Vadla Ravnås + * Copyright (C) 2024 Alex Soler + * Copyright (C) 2024 Francesco Tamagni * * Licence: wxWindows Library Licence, Version 3.1 */ @@ -222,7 +224,12 @@ gum_quick_js_event_sink_process (GumEventSink * sink, static void gum_quick_js_event_sink_flush (GumEventSink * sink) { - gum_quick_js_event_sink_drain (GUM_QUICK_JS_EVENT_SINK (sink)); + GumQuickJSEventSink * self = GUM_QUICK_JS_EVENT_SINK (sink); + + if (self->core == NULL) + return; + + gum_quick_js_event_sink_drain (self); } static void diff --git a/bindings/gumjs/gumv8eventsink.cpp b/bindings/gumjs/gumv8eventsink.cpp index 229e6b39b..68c7e1d55 100644 --- a/bindings/gumjs/gumv8eventsink.cpp +++ b/bindings/gumjs/gumv8eventsink.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2012-2022 Ole André Vadla Ravnås + * Copyright (C) 2012-2024 Ole André Vadla Ravnås + * Copyright (C) 2024 Alex Soler + * Copyright (C) 2024 Francesco Tamagni * * Licence: wxWindows Library Licence, Version 3.1 */ @@ -226,7 +228,12 @@ gum_v8_js_event_sink_process (GumEventSink * sink, static void gum_v8_js_event_sink_flush (GumEventSink * sink) { - gum_v8_js_event_sink_drain (GUM_V8_JS_EVENT_SINK (sink)); + auto self = GUM_V8_JS_EVENT_SINK (sink); + + if (self->core == NULL) + return; + + gum_v8_js_event_sink_drain (self); } static void