Fix crash due to assertion during image loading from http (#3750)

* Closes https://github.com/emilk/egui/issues/3747
This commit is contained in:
Emil Ernerfeldt 2023-12-29 17:20:52 +01:00 committed by GitHub
parent f4102c05e6
commit 239ade9a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -95,8 +95,7 @@ impl BytesLoader for EhttpLoader {
}
};
log::trace!("finished loading {uri:?}");
let prev = cache.lock().insert(uri, Poll::Ready(result));
assert!(matches!(prev, Some(Poll::Pending)));
cache.lock().insert(uri, Poll::Ready(result));
ctx.request_repaint();
}
});