Skip to content

Commit

Permalink
fix: tried to access uninitialized instance variable
Browse files Browse the repository at this point in the history
  • Loading branch information
linw1995 committed Nov 23, 2024
1 parent eb0c816 commit 48e31fa
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 48e31fa

Please sign in to comment.