aql: Fix uncaught exception when env[HOME] does not exist

parent f0c36913
......@@ -96,7 +96,11 @@ int main ( int argc, char * argv[] ) {
exceptions.push_back ( exception.error ( ) );
} );
ReadlinePromptHistory historyHandler ( std::string ( std::getenv ( "HOME" ) ) + "/.aql_history" );
const char* envHome = std::getenv ( "HOME" );
std::unique_ptr < ReadlinePromptHistory > historyHandler;
if ( envHome != nullptr ) {
historyHandler = std::make_unique < ReadlinePromptHistory > ( std::string ( envHome ) + "/.aql_history" );
}
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment