Skip to content

Commit 2421e10

Browse files
author
Steve Bendiola
committed
check for cJSON_True
1 parent c175cff commit 2421e10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IndexParser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void IndexParser::parseIndex(cJSON *index, Index::Builder *builder,
7878

7979
bool IndexParser::getBoolean(cJSON *index, const char *field) const {
8080
return cJSON_GetObjectItem(index, field)
81-
&& strcmp("true", cJSON_GetObjectItem(index, field)->string);
81+
&& cJSON_GetObjectItem(index, field)->type == cJSON_True;
8282
}
8383

8484
std::string IndexParser::getOrThrowStr(cJSON *index, const char *field) const {

0 commit comments

Comments
 (0)