diff --git a/src/backend/game/load_order_handler.cpp b/src/backend/game/load_order_handler.cpp index 1077ea4c..26950603 100644 --- a/src/backend/game/load_order_handler.cpp +++ b/src/backend/game/load_order_handler.cpp @@ -55,8 +55,9 @@ namespace loot { } const char * gameLocalDataPath = nullptr; - if (!gameLocalAppData.empty()) - gameLocalDataPath = gameLocalAppData.string().c_str(); + string tempPathString = gameLocalAppData.string(); + if (!tempPathString.empty()) + gameLocalDataPath = tempPathString.c_str(); // If the handle has already been initialised, close it and open another. if (_gh != nullptr) {