瀏覽代碼

LibWeb: Propagate error in factory method of DOM::StaticRange

Kenneth Myhra 2 年之前
父節點
當前提交
6516329867
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWeb/DOM/StaticRange.cpp

+ 1 - 1
Userland/Libraries/LibWeb/DOM/StaticRange.cpp

@@ -32,7 +32,7 @@ WebIDL::ExceptionOr<StaticRange*> StaticRange::construct_impl(JS::Realm& realm,
         return WebIDL::InvalidNodeTypeError::create(realm, "endContainer cannot be a DocumentType or Attribute node.");
 
     // 2. Set this’s start to (init["startContainer"], init["startOffset"]) and end to (init["endContainer"], init["endOffset"]).
-    return realm.heap().allocate<StaticRange>(realm, *init.start_container, init.start_offset, *init.end_container, init.end_offset).release_allocated_value_but_fixme_should_propagate_errors().ptr();
+    return MUST_OR_THROW_OOM(realm.heap().allocate<StaticRange>(realm, *init.start_container, init.start_offset, *init.end_container, init.end_offset)).ptr();
 }
 
 JS::ThrowCompletionOr<void> StaticRange::initialize(JS::Realm& realm)