diff --git a/lib/ApplicationFeatures/ClientFeature.cpp b/lib/ApplicationFeatures/ClientFeature.cpp index bb6e96c39f..23de94c229 100644 --- a/lib/ApplicationFeatures/ClientFeature.cpp +++ b/lib/ApplicationFeatures/ClientFeature.cpp @@ -131,15 +131,19 @@ void ClientFeature::validateOptions(std::shared_ptr options) { !options->processingResult().touched(_section + ".password")) { usleep(10 * 1000); - ConsoleFeature* console = - ApplicationServer::getFeature("Console"); + try { + ConsoleFeature* console = + ApplicationServer::getFeature("Console"); - if (console->isEnabled()) { - _password = console->readPassword("Please specify a password: "); - } else { - std::cout << "Please specify a password: " << std::flush; - std::getline(std::cin, _password); + if (console->isEnabled()) { + _password = console->readPassword("Please specify a password: "); + return; + } + } catch (...) { } + + std::cout << "Please specify a password: " << std::flush; + std::getline(std::cin, _password); } }