diff --git a/avogadro/io/cjsonformat.cpp b/avogadro/io/cjsonformat.cpp index 52bcf06354..3c32446f44 100644 --- a/avogadro/io/cjsonformat.cpp +++ b/avogadro/io/cjsonformat.cpp @@ -667,11 +667,18 @@ bool CjsonFormat::deserialize(std::istream& file, Molecule& molecule, // std::cout << " property: " << element.key() << " = " << matrix // << " size " << matrix.rows() << 'x' << matrix.cols() // << std::endl; + } else if (element.value().type() == json::value_t::number_float) { + molecule.setData(element.key(), element.value().get()); + } else if (element.value().type() == json::value_t::number_integer) { + molecule.setData(element.key(), element.value().get()); + } else if (element.value().type() == json::value_t::boolean) { + molecule.setData(element.key(), element.value().get()); + } else if (element.value().type() == json::value_t::string) { + molecule.setData(element.key(), element.value().get()); } else { - molecule.setData(element.key(), element.value()); - // std::cout << " property: " << element.key() << " = " - // << element.value() << " type " - // << element.value().type_name() << std::endl; + std::cout << " cannot store property: " << element.key() << " = " + << element.value() << " type " + << element.value().type_name() << std::endl; } } }