@@ -643,10 +643,10 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
643
643
for (const auto & i : m_inner) {
644
644
i.ToSections (sections, OuterType::ARR, current_indent + 2 );
645
645
}
646
- if (m_type == Type::ARR) {
646
+ CHECK_NONFATAL (!m_inner.empty ());
647
+ if (m_type == Type::ARR && m_inner.back ().m_type != Type::ELISION) {
647
648
sections.PushSection ({indent_next + " ..." , " " });
648
649
} else {
649
- CHECK_NONFATAL (!m_inner.empty ());
650
650
// Remove final comma, which would be invalid JSON
651
651
sections.m_sections .back ().m_left .pop_back ();
652
652
}
@@ -659,11 +659,11 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
659
659
for (const auto & i : m_inner) {
660
660
i.ToSections (sections, OuterType::OBJ, current_indent + 2 );
661
661
}
662
- if (m_type == Type::OBJ_DYN) {
662
+ CHECK_NONFATAL (!m_inner.empty ());
663
+ if (m_type == Type::OBJ_DYN && m_inner.back ().m_type != Type::ELISION) {
663
664
// If the dictionary keys are dynamic, use three dots for continuation
664
665
sections.PushSection ({indent_next + " ..." , " " });
665
666
} else {
666
- CHECK_NONFATAL (!m_inner.empty ());
667
667
// Remove final comma, which would be invalid JSON
668
668
sections.m_sections .back ().m_left .pop_back ();
669
669
}
0 commit comments