Skip to content

Commit 0fdb85d

Browse files
authored
fix(single-instance): Check if pointer is null for V1 (#2657)
1 parent b360e37 commit 0fdb85d

File tree

1 file changed

+3
-0
lines changed
  • plugins/single-instance/src/platform_impl

1 file changed

+3
-0
lines changed

plugins/single-instance/src/platform_impl/windows.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ unsafe extern "system" fn single_instance_window_proc<R: Runtime>(
113113
) -> LRESULT {
114114
let data_ptr = GetWindowLongPtrW(hwnd, GWL_USERDATA)
115115
as *mut (AppHandle<R>, Box<SingleInstanceCallback<R>>);
116+
if data_ptr.is_null() {
117+
return DefWindowProcW(hwnd, msg, wparam, lparam);
118+
}
116119
let (app_handle, callback) = &mut *data_ptr;
117120

118121
match msg {

0 commit comments

Comments
 (0)