Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix crash when failing to open log file for writing

Aaron Franke7a5d61816c95
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index 65e3ab5bb3c..19c820b0517 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -161,6 +161,7 @@ void RotatedFileLogger::rotate_file() {
}
file = FileAccess::open(base_path, FileAccess::WRITE);
+ ERR_FAIL_COND_MSG(file.is_null(), "Failed to open log file for writing: " + base_path);
file->detach_from_objectdb(); // Note: This FileAccess instance will exist longer than ObjectDB, therefore can't be registered in ObjectDB.
}