Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add guard in TabSqlQuery onCopyCell

Joshen Lim91227d668b55
diff --git a/studio/components/to-be-cleaned/SqlEditor/TabSqlQuery.js b/studio/components/to-be-cleaned/SqlEditor/TabSqlQuery.js
index 7f206958d29..dd0cdba43d2 100644
--- a/studio/components/to-be-cleaned/SqlEditor/TabSqlQuery.js
+++ b/studio/components/to-be-cleaned/SqlEditor/TabSqlQuery.js
@@ -358,7 +358,10 @@ const Results = ({ results }) => {
function onCopyCell() {
if (columns && cellPosition) {
const { idx, rowIdx } = cellPosition
- const colKey = columns[idx].key
+ const column = columns[idx]
+ if (!column) return
+
+ const colKey = column.key
const cellValue = results[rowIdx]?.[colKey] ?? ''
const value = formatClipboardValue(cellValue)
copyToClipboard(value)