1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

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
parent 26eeaef0a8
commit b3c4514902

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);
});