diff --git a/arangod/RestHandler/RestReplicationHandler.cpp b/arangod/RestHandler/RestReplicationHandler.cpp index 2fb53aaf82..2d7be1af3a 100644 --- a/arangod/RestHandler/RestReplicationHandler.cpp +++ b/arangod/RestHandler/RestReplicationHandler.cpp @@ -1946,19 +1946,26 @@ void RestReplicationHandler::handleCommandApplierGetStateAll() { if (_request->databaseName() != StaticStrings::SystemDatabase) { generateError(rest::ResponseCode::FORBIDDEN, TRI_ERROR_FORBIDDEN, "global inventory can only be fetched from within _system database"); + return; } DatabaseFeature* databaseFeature = application_features::ApplicationServer::getFeature("Database"); VPackBuilder builder; builder.openObject(); for (auto& name : databaseFeature->getDatabaseNames()) { - builder.add(name, VPackValue(VPackValueType::Object)); TRI_vocbase_t* vocbase = databaseFeature->lookupDatabase(name); + + if (vocbase == nullptr) { + continue; + } + ReplicationApplier* applier = vocbase->replicationApplier(); if (applier == nullptr) { - return; + continue; } + + builder.add(name, VPackValue(VPackValueType::Object)); applier->toVelocyPack(builder); builder.close(); } diff --git a/arangod/V8Server/v8-replication.cpp b/arangod/V8Server/v8-replication.cpp index d8d7642d81..e3c1c8506d 100644 --- a/arangod/V8Server/v8-replication.cpp +++ b/arangod/V8Server/v8-replication.cpp @@ -615,13 +615,19 @@ static void StateApplierReplicationAll(v8::FunctionCallbackInfo const VPackBuilder builder; builder.openObject(); for (auto& name : databaseFeature->getDatabaseNames()) { - builder.add(name, VPackValue(VPackValueType::Object)); TRI_vocbase_t* vocbase = databaseFeature->lookupDatabase(name); + + if (vocbase == nullptr) { + continue; + } + ReplicationApplier* applier = vocbase->replicationApplier(); if (applier == nullptr) { - return; + continue; } + + builder.add(name, VPackValue(VPackValueType::Object)); applier->toVelocyPack(builder); builder.close(); }