Skip to content

Commit

Permalink
Fix Type Record Rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Feb 5, 2024
1 parent d05e9d7 commit d02507a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class TypeRecordView extends ContainerView<zed.TypeRecord> {
}

count() {
return this.value.fields.length
return this.value.fields?.length || 0
}

openToken() {
Expand All @@ -21,6 +21,7 @@ export class TypeRecordView extends ContainerView<zed.TypeRecord> {

*iterate(n?: number) {
const fields = this.value.fields
if (!fields) return
const length = n ? Math.min(n, fields.length) : fields.length

for (let i = 0; i < fields.length; ++i) {
Expand Down

0 comments on commit d02507a

Please sign in to comment.