8000 Fix object requirement · lethalbrains/arangodb@016b79f · GitHub
[go: up one dir, main page]

Skip to content

Commit 016b79f

Browse files
author
Andreas Streichardt
committed
Fix object requirement
1 parent dc95f2b commit 016b79f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arangod/Cluster/ClusterInfo.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class CollectionInfo {
7575
//////////////////////////////////////////////////////////////////////////////
7676

7777
int replicationFactor () const {
78+
if (!_slice.isObject()) {
79+
return 1;
80+
}
7881
return arangodb::basics::VelocyPackHelper::getNumericValue<TRI_voc_size_t>(
7982
_slice, "replicationFactor", 1);
8083
}
@@ -129,6 +132,9 @@ class CollectionInfo {
129132
//////////////////////////////////////////////////////////////////////////////
130133

131134
TRI_col_type_e type() const {
135+
if (!_slice.isObject()) {
136+
return TRI_COL_TYPE_UNKNOWN;
137+
}
132138
return (TRI_col_type_e)arangodb::basics::VelocyPackHelper::getNumericValue<int>(
133139
_slice, "type", (int)TRI_COL_TYPE_UNKNOWN);
134140
}
@@ -138,6 +144,9 @@ class CollectionInfo {
138144
//////////////////////////////////////////////////////////////////////////////
139145

140146
TRI_vocbase_col_status_e status() const {
147+
if (!_slice.isObject()) {
148+
return TRI_VOC_COL_STATUS_CORRUPTED;
149+
}
141150
return (TRI_vocbase_col_status_e)
142151
arangodb::basics::VelocyPackHelper::getNumericValue<int>(
143152
_slice, "status", (int)TRI_VOC_COL_STATUS_CORRUPTED);
@@ -246,6 +255,9 @@ class CollectionInfo {
246255
//////////////////////////////////////////////////////////////////////////////
247256

248257
uint32_t indexBuckets() const {
258+
if (!_slice.isObject()) {
259+
return 1;
260+
}
249261
return arangodb::basics::VelocyPackHelper::getNumericValue<uint32_t>(
250262
_slice, "indexBuckets", 1);
251263
}

0 commit comments

Comments
 (0)
0