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 ProjectContentStore loadRecentLogSqlSnippets

Joshen Lim36c87ed0efd5
diff --git a/studio/stores/project/ProjectContentStore.ts b/studio/stores/project/ProjectContentStore.ts
index 13d35d18297..cb77c532021 100644
--- a/studio/stores/project/ProjectContentStore.ts
+++ b/studio/stores/project/ProjectContentStore.ts
@@ -178,9 +178,9 @@ export default class ProjectContentStore implements IProjectContentStore {
}
loadRecentLogSqlSnippets() {
- if (typeof window === 'undefined') return
+ if (typeof window === 'undefined' || !window.localStorage) return
this.recentLogSqlSnippets = JSON.parse(
- (window as any).localStorage.getItem(this.recentLogSqlKey) || '[]'
+ window.localStorage.getItem(this.recentLogSqlKey) || '[]'
)
}