zui icon indicating copy to clipboard operation
zui copied to clipboard

null rootRecord when clicking primitive value in Inspector view

Open philrz opened this issue 8 months ago • 0 comments

Repro is with Zui commit b727a2e.

Steps shown in the attached video:

  1. Begin Preview & Load of the attached words.gz test data (after uncompressing)
  2. Select the Line data format
  3. Click Query Pool
  4. Click to switch to the Inspector view
  5. Click a value in the table

As shown in the attached video, this generates an Unhandled Runtime Error.

https://github.com/brimdata/zui/assets/5934157/f54080ce-d628-4504-8058-6fc8d6c4567f

That error text:

Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'rootRecord')

Source
src/views/results-pane/inspector.tsx (64:34) @ rootRecord

  62 | valueProps={{
  63 |   onClick: (e, value, field) => {
> 64 |     const rootValue = field.rootRecord
     |                            ^
  65 |     dispatch(Selection.set({value, field, rootValue}))
  66 |     if (field && field instanceof zed.Field) {
  67 |       dispatch(viewLogDetail(field.rootRecord))
Call Stack
fn
src/views/inspector/templates/item.tsx (14:12)

FWIW,

  1. This error is not new. I could repro it in the last GA Zui release v1.7.0, for instance.
  2. This error is not visible to the user in a production build. It that case it goes only to DevTools.

So, probably not a high priority, but worth cleaning up at some point.

philrz avatar Jun 21 '24 03:06 philrz