Mark image as empty if network request fails
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user