Fix editor crash attempting to generate preview for invalid BitMap
Fixes #114246.
This commit is contained in:
committed by
Rémi Verschelde
parent
8dcf5b4eaf
commit
e9b32de2a5
@@ -231,6 +231,9 @@ bool EditorBitmapPreviewPlugin::handles(const String &p_type) const {
|
||||
|
||||
Ref<Texture2D> EditorBitmapPreviewPlugin::generate(const Ref<Resource> &p_from, const Size2 &p_size, Dictionary &p_metadata) const {
|
||||
Ref<BitMap> bm = p_from;
|
||||
if (bm.is_null()) {
|
||||
return Ref<Texture2D>();
|
||||
}
|
||||
|
||||
if (bm->get_size() == Size2()) {
|
||||
return Ref<Texture2D>();
|
||||
|
||||
Reference in New Issue
Block a user