1
0
Fork 0

prevent segfault

This commit is contained in:
Jan Steemann 2015-12-22 11:12:16 +01:00
parent 55855780dd
commit dcb8c4f174
1 changed files with 9 additions and 4 deletions

View File

@ -1640,8 +1640,10 @@ static void RunShell (v8::Isolate* isolate, v8::Handle<v8::Context> context, boo
// this will change the prompt for the next round // this will change the prompt for the next round
promptError = true; promptError = true;
} }
ClientConnection->setInterrupted(false); if (ClientConnection) {
ClientConnection->setInterrupted(false);
}
BaseClient.stopPager(); BaseClient.stopPager();
BaseClient.printLine(""); BaseClient.printLine("");
@ -2038,7 +2040,9 @@ static bool PrintHelo (bool useServer) {
BaseClient.printWelcomeInfo(); BaseClient.printWelcomeInfo();
if (useServer) { if (useServer) {
if (ClientConnection->isConnected() && ClientConnection->getLastHttpReturnCode() == HttpResponse::OK) { if (ClientConnection &&
ClientConnection->isConnected() &&
ClientConnection->getLastHttpReturnCode() == HttpResponse::OK) {
ostringstream is; ostringstream is;
is << "Connected to ArangoDB '" << BaseClient.endpointString() is << "Connected to ArangoDB '" << BaseClient.endpointString()
<< "' version: " << ClientConnection->getVersion() << "' version: " << ClientConnection->getVersion()
@ -2054,7 +2058,8 @@ static bool PrintHelo (bool useServer) {
<< "', username: '" << BaseClient.username() << "'"; << "', username: '" << BaseClient.username() << "'";
BaseClient.printErrLine(is.str()); BaseClient.printErrLine(is.str());
if (ClientConnection->getErrorMessage() != "") { if (ClientConnection &&
ClientConnection->getErrorMessage() != "") {
ostringstream is2; ostringstream is2;
is2 << "Error message '" << ClientConnection->getErrorMessage() << "'"; is2 << "Error message '" << ClientConnection->getErrorMessage() << "'";
BaseClient.printErrLine(is2.str()); BaseClient.printErrLine(is2.str());