[PR #5390] [MERGED] fix: add optional chaining for process.platform #5974

Closed
opened 2026-03-13 12:43:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5390
Author: @bytaesu
Created: 10/17/2025
Status: Merged
Merged: 10/17/2025
Merged by: @himself65

Base: canaryHead: fix/safe-process-platform-access


📝 Commits (1)

  • 624acbb fix: add optional chaining for process.platform

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/core/src/env/color-depth.ts (+1 -1)

📄 Description

Added optional chaining to process.platform check. Prevents errors in edge environments where process may be undefined.

Consistent with existing codebase:
https://github.com/better-auth/better-auth/blob/canary/packages/telemetry/src/detectors/detect-system-info.ts#L151

Closes https://github.com/better-auth/better-auth/issues/5376


Summary by cubic

Safely check process.platform in getColorDepth using optional chaining to prevent crashes in edge runtimes where process may be undefined. Keeps Windows true-color detection intact. Closes #5376.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5390 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 10/17/2025 **Status:** ✅ Merged **Merged:** 10/17/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/safe-process-platform-access` --- ### 📝 Commits (1) - [`624acbb`](https://github.com/better-auth/better-auth/commit/624acbb93abe884daf87725242f9cc0f65ff1091) fix: add optional chaining for process.platform ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/env/color-depth.ts` (+1 -1) </details> ### 📄 Description Added optional chaining to `process.platform` check. Prevents errors in edge environments where `process` may be undefined. Consistent with existing codebase: https://github.com/better-auth/better-auth/blob/canary/packages/telemetry/src/detectors/detect-system-info.ts#L151 Closes https://github.com/better-auth/better-auth/issues/5376 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Safely check process.platform in getColorDepth using optional chaining to prevent crashes in edge runtimes where process may be undefined. Keeps Windows true-color detection intact. Closes #5376. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:43:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5974