mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
GH 23: JSON::Object::stringify throw BadCastException
GH issue #23 : JSON::Object::stringify throw BadCastException
This commit is contained in:
@@ -49,7 +49,17 @@ namespace JSON {
|
||||
|
||||
void Stringifier::stringify(const Var& any, std::ostream& out, unsigned int indent)
|
||||
{
|
||||
if ( any.type() == typeid(Object::Ptr) )
|
||||
if ( any.type() == typeid(Object) )
|
||||
{
|
||||
const Object& o = any.extract<Object>();
|
||||
o.stringify(out, indent == 0 ? 0 : indent + 2);
|
||||
}
|
||||
else if ( any.type() == typeid(Array) )
|
||||
{
|
||||
const Array& a = any.extract<Array>();
|
||||
a.stringify(out, indent == 0 ? 0 : indent + 2);
|
||||
}
|
||||
else if ( any.type() == typeid(Object::Ptr) )
|
||||
{
|
||||
const Object::Ptr& o = any.extract<Object::Ptr>();
|
||||
o->stringify(out, indent == 0 ? 0 : indent + 2);
|
||||
|
||||
Reference in New Issue
Block a user