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
promptError = true;
}
ClientConnection->setInterrupted(false);
if (ClientConnection) {
ClientConnection->setInterrupted(false);
}
BaseClient.stopPager();
BaseClient.printLine("");
@ -2038,7 +2040,9 @@ static bool PrintHelo (bool useServer) {
BaseClient.printWelcomeInfo();
if (useServer) {
if (ClientConnection->isConnected() && ClientConnection->getLastHttpReturnCode() == HttpResponse::OK) {
if (ClientConnection &&
ClientConnection->isConnected() &&
ClientConnection->getLastHttpReturnCode() == HttpResponse::OK) {
ostringstream is;
is << "Connected to ArangoDB '" << BaseClient.endpointString()
<< "' version: " << ClientConnection->getVersion()
@ -2054,7 +2058,8 @@ static bool PrintHelo (bool useServer) {
<< "', username: '" << BaseClient.username() << "'";
BaseClient.printErrLine(is.str());
if (ClientConnection->getErrorMessage() != "") {
if (ClientConnection &&
ClientConnection->getErrorMessage() != "") {
ostringstream is2;
is2 << "Error message '" << ClientConnection->getErrorMessage() << "'";
BaseClient.printErrLine(is2.str());