Skip to content

Commit

Permalink
fix: tried to access uninitialized instance variable (#1425)
Browse files Browse the repository at this point in the history
  • Loading branch information
linw1995 authored Jan 1, 2025
1 parent 413817c commit 72f386f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wkwebview/class/url_scheme_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,15 @@ extern "C" fn start_task(
}))
.unwrap();

webview.remove_custom_task_key(task_key);
Ok(())
{
let ids = WEBVIEW_IDS.lock().unwrap();
if ids.contains(webview_id) {
webview.remove_custom_task_key(task_key);
Ok(())
} else {
Err(crate::Error::CustomProtocolTaskInvalid)
}
}
}

let _ = response(
Expand Down

0 comments on commit 72f386f

Please sign in to comment.