diff --git a/.changeset/fix-copy-row-json-button.md b/.changeset/fix-copy-row-json-button.md new file mode 100644 index 00000000..2dfc9db7 --- /dev/null +++ b/.changeset/fix-copy-row-json-button.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/app": patch +--- + +fix: Fix "Copy entire row as JSON" button crashing on rows with non-string values diff --git a/packages/app/src/components/DBTable/DBRowTableRowButtons.tsx b/packages/app/src/components/DBTable/DBRowTableRowButtons.tsx index 6e6b6fae..6e0fc23f 100644 --- a/packages/app/src/components/DBTable/DBRowTableRowButtons.tsx +++ b/packages/app/src/components/DBTable/DBRowTableRowButtons.tsx @@ -35,8 +35,8 @@ const DBRowTableRowButtons: React.FC = ({ const parsedRow = Object.entries(cleanRow).reduce( (acc, [key, value]) => { if ( - (typeof value === 'string' && value.startsWith('{')) || - value.startsWith('[') + typeof value === 'string' && + (value.startsWith('{') || value.startsWith('[')) ) { try { acc[key] = JSON.parse(value);