diff --git a/src/inspect_ai/_view/www/dist/assets/index.js b/src/inspect_ai/_view/www/dist/assets/index.js index 916788909..9fa13d25c 100644 --- a/src/inspect_ai/_view/www/dist/assets/index.js +++ b/src/inspect_ai/_view/www/dist/assets/index.js @@ -15718,7 +15718,7 @@ const generatePreview = (changes, resolvedState) => { const requiredMatchCount = changeType.signature.remove.length + changeType.signature.replace.length + changeType.signature.add.length; let matchingOps = 0; for (const change of changes) { - if (changeType.signature[change.op].length > 0) { + if (changeType.signature[change.op] && changeType.signature[change.op].length > 0) { changeType.signature[change.op].forEach((signature) => { if (change.path.match(signature)) { matchingOps++; diff --git a/src/inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs b/src/inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs index 00ff14fbe..7bc3a62f9 100644 --- a/src/inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs +++ b/src/inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs @@ -64,13 +64,19 @@ export const StateEventView = ({ id, event, style, stateManager }) => { const generatePreview = (changes, resolvedState) => { const results = []; for (const changeType of RenderableChangeTypes) { + // Note that we currently only have renderers that depend upon + // add, remove, replace, but we should likely add + // move, copy, test const requiredMatchCount = changeType.signature.remove.length + changeType.signature.replace.length + changeType.signature.add.length; let matchingOps = 0; for (const change of changes) { - if (changeType.signature[change.op].length > 0) { + if ( + changeType.signature[change.op] && + changeType.signature[change.op].length > 0 + ) { changeType.signature[change.op].forEach((signature) => { if (change.path.match(signature)) { matchingOps++;