fix(ui): null in JSON array crashes ComplexLogItem (#4780)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Amir Raminfar
2026-06-04 08:37:59 -07:00
committed by GitHub
parent de368a1d97
commit eb5c8fac1b
2 changed files with 6 additions and 1 deletions
@@ -53,6 +53,11 @@ describe("<ComplexLogItem />", () => {
expect(wrapper.find(".array").text()).toContain("b");
});
test("renders null inside an array without throwing", () => {
const wrapper = mountItem({ tags: ["a", null, "b"] } as any);
expect(wrapper.find(".array").text()).toContain("null");
});
test("shows a placeholder when every value is hidden", () => {
const visibleKeys = ref(new Map<string[], boolean>([[["a"], false]]));
const wrapper = mountItem({ a: 1 }, visibleKeys);
@@ -15,7 +15,7 @@
class="after:text-base-content/70 not-last:after:content-[',']"
>
<ReuseTemplate :data="item" v-if="isObject(item) || Array.isArray(item)" />
<span v-else class="value" :class="typeof item" v-html="stripAnsi(item.toString())"></span>
<span v-else class="value" :class="typeof item" v-html="stripAnsi(String(item))"></span>
</li>
</ul>
</li>