diff options
Diffstat (limited to 'ZAPDUtils/Utils/File.h')
| -rw-r--r-- | ZAPDUtils/Utils/File.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ZAPDUtils/Utils/File.h b/ZAPDUtils/Utils/File.h index 084152f..7bc5d29 100644 --- a/ZAPDUtils/Utils/File.h +++ b/ZAPDUtils/Utils/File.h @@ -33,6 +33,8 @@ public: static std::string ReadAllText(const fs::path& filePath) { std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate); + if (!file.is_open()) + return ""; int32_t fileSize = (int32_t)file.tellg(); file.seekg(0); char* data = new char[fileSize + 1]; |
