mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
LibWeb: Convert NodeOperations to use TRY for error propagation
This commit is contained in:
parent
3861396fe4
commit
8d20fb1e94
Notes:
sideshowbarker
2024-07-17 16:54:07 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/8d20fb1e94 Pull-request: https://github.com/SerenityOS/serenity/pull/13192
@ -35,9 +35,7 @@ ExceptionOr<NonnullRefPtr<Node>> convert_nodes_to_single_node(Vector<Variant<Non
|
||||
NonnullRefPtr<Node> document_fragment = adopt_ref(*new DocumentFragment(document));
|
||||
for (auto& unconverted_node : nodes) {
|
||||
auto node = potentially_convert_string_to_text_node(unconverted_node);
|
||||
auto result = document_fragment->append_child(node);
|
||||
if (result.is_exception())
|
||||
return result.exception();
|
||||
(void)TRY(document_fragment->append_child(node));
|
||||
}
|
||||
|
||||
return document_fragment;
|
||||
|
Loading…
Reference in New Issue
Block a user