From d6426e4af97b1b411b373f98927084eaad6e0625 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 Nov 2019 11:58:47 +0100 Subject: LibHTML: Allow resource loads to fail It's perfectly normal for resource loads to fail sometimes. When they do, we now simply pass a null buffer to the callback. --- Libraries/LibHTML/ResourceLoader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Libraries/LibHTML') diff --git a/Libraries/LibHTML/ResourceLoader.cpp b/Libraries/LibHTML/ResourceLoader.cpp index 12084d2dc5..2e0fcdbf60 100644 --- a/Libraries/LibHTML/ResourceLoader.cpp +++ b/Libraries/LibHTML/ResourceLoader.cpp @@ -43,7 +43,8 @@ void ResourceLoader::load(const URL& url, Function call on_load_counter_change(); if (!success) { dbg() << "HTTP load failed!"; - ASSERT_NOT_REACHED(); + callback({}); + return; } callback(ByteBuffer::copy(payload.data(), payload.size())); }; -- cgit v1.2.3