fix(CORE): crash when AC_DISABLE_INTERACTIVE is not defined

This commit is contained in:
Yehonal
2022-10-21 23:05:05 +02:00
parent 99bce5672c
commit 53219310cf

View File

@@ -172,9 +172,9 @@ bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
{
LOG_WARN("sql.updates", "Database \"{}\" does not exist", pool.GetConnectionInfo()->database);
const char* interactiveOpt = std::getenv("AC_DISABLE_INTERACTIVE");
const char* disableInteractive = std::getenv("AC_DISABLE_INTERACTIVE");
if (!sConfigMgr->isDryRun() && std::strcmp(interactiveOpt, "1") != 0)
if (!sConfigMgr->isDryRun() && (disableInteractive == nullptr || std::strcmp(disableInteractive, "1") != 0))
{
std::cout << "Do you want to create it? [yes (default) / no]:" << std::endl;
std::string answer;