LibWeb: Don't call an absent error callback in load_sync()

Make ResourceLoader::load_sync() match load() in checking if the
error_callback is null before actually calling it.

Fixes #1623.
This commit is contained in:
Andreas Kling 2020-04-04 14:17:39 +02:00
commit b3c4514902
Notes: sideshowbarker 2024-07-19 07:56:31 +09:00

View file

@ -57,7 +57,8 @@ void ResourceLoader::load_sync(const URL& url, Function<void(const ByteBuffer&)>
loop.quit(0);
},
[&](auto& string) {
error_callback(string);
if (error_callback)
error_callback(string);
loop.quit(0);
});