Skip to content

Commit

Permalink
jsonrpc: fix default value checking for enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Jan 31, 2012
1 parent 59b1ee4 commit 17c23a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const CVariant &value, JSONSch
if (value.isMember("default") && IsType(value["default"], type.type)) if (value.isMember("default") && IsType(value["default"], type.type))
{ {
bool ok = false; bool ok = false;
if (type.enums.size() >= 0) if (type.enums.size() <= 0)
ok = true; ok = true;
// If the type has an enum definition we must make // If the type has an enum definition we must make
// sure that the default value is a valid enum value // sure that the default value is a valid enum value
Expand Down Expand Up @@ -1499,7 +1499,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const CVariant &value, JSONSch
bool ok = false; bool ok = false;
if (value.isMember("default") && IsType(value["default"], type.type)) if (value.isMember("default") && IsType(value["default"], type.type))
{ {
if (type.enums.size() >= 0) if (type.enums.size() <= 0)
ok = true; ok = true;
// If the type has an enum definition we must make // If the type has an enum definition we must make
// sure that the default value is a valid enum value // sure that the default value is a valid enum value
Expand Down

0 comments on commit 17c23a1

Please sign in to comment.