From f0ac8294cba557ac7d3244a152a053224c6737ae Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:18:46 +0200 Subject: [PATCH] [Windows] Add missing opened file check. --- drivers/windows/file_access_windows.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index b2796e4e67b..a8e2a6859bc 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -308,6 +308,8 @@ void FileAccessWindows::seek_end(int64_t p_position) { } uint64_t FileAccessWindows::get_position() const { + ERR_FAIL_NULL_V_MSG(f, 0, "File must be opened before use."); + int64_t aux_position = _ftelli64(f); if (aux_position < 0) { check_errors();