Forráskód Böngészése

Merge pull request #102803 from bruvzg/msvc_ftelli

[Windows] Add missing opened file check.
Thaddeus Crews 8 hónapja
szülő
commit
b3feaab96f
1 módosított fájl, 2 hozzáadás és 0 törlés
  1. 2 0
      drivers/windows/file_access_windows.cpp

+ 2 - 0
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();