From f8a668c6966db645825592d4e6d5d73ad5618d6e Mon Sep 17 00:00:00 2001 From: travis Date: Mon, 10 Apr 2023 18:38:33 -0500 Subject: [PATCH] Make sure there is an onPointerClick when setting the copyableValue, if not fallback to stringify. The crash happens occurs when adding a new row via the modal then selecting a filed to add where the class being added has a field type array of pointers [Error] TypeError: undefined is not an object (evaluating 'it.bind') (anonymous function) (bind.js:7) (anonymous function) (BrowserCell.react.js:194:116) map renderCellContent (BrowserCell.react.js:184:137) componentDidMount (BrowserCell.react.js:540) commitLifeCycles (react-dom.development.js:19814) commitLayoutEffects (react-dom.development.js:22803) callCallback (react-dom.development.js:188) dispatchEvent invokeGuardedCallbackDev (react-dom.development.js:237) invokeGuardedCallback (react-dom.development.js:292) commitRootImpl (react-dom.development.js:22541) commitRootImpl unstable_runWithPriority (scheduler.development.js:653) commitRoot (react-dom.development.js:22381) finishSyncRender (react-dom.development.js:21807) performSyncWorkOnRoot (react-dom.development.js:21793) performSyncWorkOnRoot (anonymous function) (react-dom.development.js:11089) unstable_runWithPriority (scheduler.development.js:653) flushSyncCallbackQueueImpl (react-dom.development.js:11084) flushSyncCallbackQueue (react-dom.development.js:11072) scheduleUpdateOnFiber (react-dom.development.js:21199) enqueueSetState (react-dom.development.js:12639) (anonymous function) (react.development.js:471) _callee3$ (ObjectPickerDialog.react.js:245) tryCatch (regeneratorRuntime.js:53) (anonymous function) (regeneratorRuntime.js:135) asyncGeneratorStep (asyncToGenerator.js:9) _next (asyncToGenerator.js:28) --- src/components/BrowserCell/BrowserCell.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 96d40b8fcc..5e29604bbf 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -92,7 +92,7 @@ export default class BrowserCell extends Component { this.copyableValue = this.props.value.id; } else if (this.props.type === 'Array') { - if ( this.props.value[0] && typeof this.props.value[0] === 'object' && this.props.value[0].__type === 'Pointer' ) { + if ( this.props.value[0] && typeof this.props.value[0] === 'object' && this.props.value[0].__type === 'Pointer' && typeof this.props.onPointerClick === 'function' ) { const array = []; this.props.value.map( (v, i) => { if ( typeof v !== 'object' || v.__type !== 'Pointer' ) {