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.
This commit is contained in:
Andreas Kling 2019-11-30 11:58:47 +01:00
parent 039fc0f2d1
commit d6426e4af9
Notes: sideshowbarker 2024-07-19 11:01:27 +09:00

View file

@ -43,7 +43,8 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&)> call
on_load_counter_change();
if (!success) {
dbg() << "HTTP load failed!";
ASSERT_NOT_REACHED();
callback({});
return;
}
callback(ByteBuffer::copy(payload.data(), payload.size()));
};