summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2019-11-20 10:49:24 -0800
committerK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2019-11-20 10:49:24 -0800
commit3b44866bf2e3be0870df9cbe377afe811f06071c (patch)
treead9ecd21404f134347abb23eeb6eaba110c5e4b3 /editor/import
parent73323a2838f4978b1f91d7a941ac40ee17df2d34 (diff)
33714 If the gltf2 asset has no scene, it is corrupt.
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index fcf0e4af6f..30e2aae020 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);