Skip to content

Commit b3feaab

Browse files
committed
Merge pull request #102803 from bruvzg/msvc_ftelli
[Windows] Add missing opened file check.
2 parents d333159 + f0ac829 commit b3feaab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/windows/file_access_windows.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ void FileAccessWindows::seek_end(int64_t p_position) {
308308
}
309309

310310
uint64_t FileAccessWindows::get_position() const {
311+
ERR_FAIL_NULL_V_MSG(f, 0, "File must be opened before use.");
312+
311313
int64_t aux_position = _ftelli64(f);
312314
if (aux_position < 0) {
313315
check_errors();

0 commit comments

Comments
 (0)