diff --git a/Framework/DataObjects/src/PeakShapeSpherical.cpp b/Framework/DataObjects/src/PeakShapeSpherical.cpp index 1e79b6af19dfa61b31d6dbc9bd4bce0bbbfbe5fa..68e65e66e9c047e277444354451b8cb8e91d22b2 100644 --- a/Framework/DataObjects/src/PeakShapeSpherical.cpp +++ b/Framework/DataObjects/src/PeakShapeSpherical.cpp @@ -53,13 +53,10 @@ std::string PeakShapeSpherical::toJSON() const { Json::Value root; PeakShapeBase::buildCommon(root); root["radius"] = Json::Value(m_radius); - // Check that there is an inner radius before writing - if (m_backgroundInnerRadius.is_initialized()) { + + if (m_backgroundInnerRadius && m_backgroundOuterRadius) { root["background_outer_radius"] = Json::Value(m_backgroundOuterRadius.get()); - } - // Check that there is an outer radius before writing - if (m_backgroundOuterRadius.is_initialized()) { root["background_inner_radius"] = Json::Value(m_backgroundInnerRadius.get()); }