You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Add checks after ResourceLoader::load()
This commit is contained in:
@@ -5528,6 +5528,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String path = files[i];
|
||||
RES res = ResourceLoader::load(path);
|
||||
ERR_FAIL_COND(res.is_null());
|
||||
Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(*res));
|
||||
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
|
||||
if (texture != NULL || scene != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user