diff --git a/src/main.cpp b/src/main.cpp index cdf40d3..8610d83 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,6 +47,8 @@ int toInt(const std::string &str) { void readConfig() { std::ifstream file("config.txt"); + if(!file) + return; std::string line; while(std::getline(file, line)) { @@ -72,6 +74,8 @@ void readConfig() { void writeConfig() { std::ofstream file("config.txt"); + if(!file) + return; int x, y; SDL_GetWindowPosition(window, &x, &y);