fix(single-instance): check if pointer is null (#2452)

This commit is contained in:
Fabian-Lars authored and GitHub committed 2025-02-23 19:25:00 +02:00
1 parent c10d5bfb54
commit 1ab5f15763
3 files changed
+11 -1

No files matched your search

@@ -118,6 +118,11 @@ unsafe extern "system" fn single_instance_window_proc<R: Runtime>(
) -> LRESULT {
let data_ptr = GetWindowLongPtrW(hwnd, GWL_USERDATA)
as *mut (AppHandle<R>, Box<SingleInstanceCallback<R>>);
if data_ptr.is_null() {
return DefWindowProcW(hwnd, msg, wparam, lparam);
}
let (app_handle, callback) = &mut *data_ptr;
match msg {