Skip to content

undefined _observer in c-table disconnectedCallback #240

@juholehtocsc

Description

@juholehtocsc

Happens rarely, but still happens.

The component throws in disconnectedCallback because _observer is not always initialized before teardown.

Affected version
@cscfi/csc-ui 3.0.19

Error
TypeError: Cannot read properties of undefined (reading 'disconnect')
at Lt.disconnectedCallback (c-table.tsx:114:20)

this._observer.disconnect();
without a null guard.
The same package appears to use null-safe teardown in other components (for example c-data-table uses optional chaining), so this looks inconsistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions