Skip to content

Conversation

@aman19K
Copy link
Contributor

@aman19K aman19K commented Jul 25, 2025

This PR fixes issues related to accessing properties of undefined objects by adding null checks throughout the codebase. The primary purpose is to prevent runtime errors when objects or arrays are undefined or null.

Adds optional chaining and null checks to prevent "cannot read properties of undefined" errors
Enhances error handling with improved user-friendly messages for authentication and network errors
Implements sensitive data redaction in request/response payloads

@aman19K aman19K requested a review from a team as a code owner July 25, 2025 05:05
@aman19K aman19K requested review from Copilot and removed request for a team July 25, 2025 05:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues related to accessing properties of undefined objects by adding null checks throughout the codebase. The primary purpose is to prevent runtime errors when objects or arrays are undefined or null.

  • Adds optional chaining and null checks to prevent "cannot read properties of undefined" errors
  • Enhances error handling with improved user-friendly messages for authentication and network errors
  • Implements sensitive data redaction in request/response payloads

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/contentstack-utilities/src/logger/cli-error-handler.ts Enhanced error handling with null checks, improved error messages, and data redaction
packages/contentstack-utilities/src/helpers.ts Added null checks and enhanced error formatting with user-friendly messages
packages/contentstack-export/src/export/modules/entries.ts Added optional chaining to prevent undefined access on array length
packages/contentstack-export/src/export/modules/custom-roles.ts Added optional chaining throughout to prevent undefined property access
packages/contentstack-export/src/export/modules/content-types.ts Added optional chaining for array length checks

@aman19K aman19K requested a review from cs-raj July 25, 2025 05:21
cs-raj
cs-raj previously approved these changes Jul 25, 2025
@aman19K aman19K requested a review from shafeeqd959 July 25, 2025 06:27
@shafeeqd959 shafeeqd959 merged commit 6f91252 into staging Jul 25, 2025
10 of 11 checks passed
@shafeeqd959 shafeeqd959 deleted the fix/logger-undefined-issue branch July 25, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants