Skip to content

Commit ff8a278

Browse files
committed
Merge pull request godotengine#94506 from Jordyfel/handle-gltf-bin-missing
Fix handling of missing bin file in gltf separate
2 parents 60966f5 + 416e63a commit ff8a278

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/gltf/gltf_document.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,9 @@ Error GLTFDocument::_parse_buffers(Ref<GLTFState> p_state, const String &p_base_
789789
ERR_FAIL_COND_V(p_base_path.is_empty(), ERR_INVALID_PARAMETER);
790790
uri = uri.uri_decode();
791791
uri = p_base_path.path_join(uri).replace("\\", "/"); // Fix for Windows.
792+
ERR_FAIL_COND_V_MSG(!FileAccess::exists(uri), ERR_FILE_NOT_FOUND, "glTF: Binary file not found: " + uri);
792793
buffer_data = FileAccess::get_file_as_bytes(uri);
793-
ERR_FAIL_COND_V_MSG(buffer.is_empty(), ERR_PARSE_ERROR, "glTF: Couldn't load binary file as an array: " + uri);
794+
ERR_FAIL_COND_V_MSG(buffer_data.is_empty(), ERR_PARSE_ERROR, "glTF: Couldn't load binary file as an array: " + uri);
794795
}
795796

796797
ERR_FAIL_COND_V(!buffer.has("byteLength"), ERR_PARSE_ERROR);

0 commit comments

Comments
 (0)