From 3b44866bf2e3be0870df9cbe377afe811f06071c Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Wed, 20 Nov 2019 10:49:24 -0800 Subject: [PATCH] 33714 If the gltf2 asset has no scene, it is corrupt. --- editor/import/editor_scene_importer_gltf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index fcf0e4af6f9..30e2aae0207 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -229,6 +229,7 @@ Error EditorSceneImporterGLTF::_parse_scenes(GLTFState &state) { ERR_FAIL_COND_V(!state.json.has("scenes"), ERR_FILE_CORRUPT); const Array &scenes = state.json["scenes"]; + ERR_FAIL_COND_V(!scenes.size(), ERR_FILE_CORRUPT); for (int i = 0; i < 1; i++) { //only first scene is imported const Dictionary &s = scenes[i]; ERR_FAIL_COND_V(!s.has("nodes"), ERR_UNAVAILABLE);