diff options
author | Andriy Sultanov <53952748+last-genius@users.noreply.github.com> | 2024-09-05 04:25:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 03:25:49 +0000 |
commit | aadc212b95cdef2a25475f025aa7fab659dde646 (patch) | |
tree | e3123db81d75a67f75e3e84934fd069cdeb7ad01 /components/script/script_module.rs | |
parent | 642c25d9a73b2c3fbe6f98a32bae5c7bdb6c448f (diff) | |
download | servo-aadc212b95cdef2a25475f025aa7fab659dde646.tar.gz servo-aadc212b95cdef2a25475f025aa7fab659dde646.zip |
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>
Diffstat (limited to 'components/script/script_module.rs')
-rw-r--r-- | components/script/script_module.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/script_module.rs b/components/script/script_module.rs index f277368d13e..db155fa4f00 100644 --- a/components/script/script_module.rs +++ b/components/script/script_module.rs @@ -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) { |