1
0
Fork 0

fix potential nullptr dereference

This commit is contained in:
jsteemann 2016-12-27 18:42:22 +01:00
parent a215a8ebe2
commit a7616ed0f6
1 changed files with 1 additions and 9 deletions

View File

@ -593,16 +593,8 @@ int Syncer::dropIndex(arangodb::velocypack::Slice const& slice) {
TRI_voc_cid_t const cid = getCid(slice);
std::string cnameString = getCName(slice);
// TODO
// Backwards compatibility. old check to nullptr, new is empty string
// Other api does not know yet.
char const* cname = nullptr;
if (!cnameString.empty()) {
cname = cnameString.c_str();
}
try {
CollectionGuard guard(_vocbase, cid, std::string(cname));
CollectionGuard guard(_vocbase, cid, cnameString);
if (guard.collection() == nullptr) {
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;