mirror of https://gitee.com/bigwinds/arangodb
prevent segfault
This commit is contained in:
parent
55855780dd
commit
dcb8c4f174
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue