mirror of
https://github.com/servo/servo.git
synced 2025-06-12 10:24:43 +00:00
jsstring_to_str should accept a NonNull argument for the JS string (#33306)
Instead of asserting the raw pointer is not null, force callers to produce a NonNull pointer. Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
This commit is contained in:
parent
642c25d9a7
commit
aadc212b95
6 changed files with 40 additions and 38 deletions
|
@ -609,7 +609,7 @@ impl ModuleTree {
|
|||
url: &ServoUrl,
|
||||
specifier: RawHandle<*mut JSString>,
|
||||
) -> Result<ServoUrl, UrlParseError> {
|
||||
let specifier_str = unsafe { jsstring_to_str(cx, *specifier) };
|
||||
let specifier_str = unsafe { jsstring_to_str(cx, ptr::NonNull::new(*specifier).unwrap()) };
|
||||
|
||||
// Step 1.
|
||||
if let Ok(specifier_url) = ServoUrl::parse(&specifier_str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue