Mark image as empty if network request fails

This commit is contained in:
Rasmus Karlsson 2018-09-01 12:47:02 +00:00
parent d16307a484
commit 4752a3a4d4

View file

@ -310,6 +310,14 @@ void Image::load()
return Success;
});
req.onError([that = this, weak = weakOf(this)](auto result) -> bool {
auto shared = weak.lock();
if (!shared) return false;
shared->empty_ = true;
return true;
});
req.execute();
}