Add support for serializing empty Variants.

This commit is contained in:
Gunnar Beutner 2012-07-24 13:33:38 +02:00
parent d0b2335abb
commit bd8e0a9001
1 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,8 @@ cJSON *Variant::ToJson(void) const
Logger::Write(LogDebug, "base", "Ignoring unknown object while converting variant to JSON.");
return cJSON_CreateNull();
}
} else if (m_Value.type() == typeid(boost::blank)) {
return cJSON_CreateNull();
} else {
throw runtime_error("Invalid variant type.");
}