Skip to content

Conversation

@hobostay
Copy link

@hobostay hobostay commented Feb 9, 2026

Summary

This PR fixes three issues in apps/ui-tars/src/main/main.ts:

  1. Fix potential null reference crash - Added null check for primarySource in setDisplayMediaRequestHandler. Previously used non-null assertion operator ! which could cause runtime error when no matching source is found.

  2. Improve error logging consistency - Changed console.log to logger.error in the .catch() handler for consistency with the project's logging pattern.

  3. Remove duplicate event handler - Removed duplicate window-all-closed event listener registration (registered at both lines 119-124 and 209-214).

Changes

  • Added null safety check for primarySource with fallback to first available source
  • Added warning log when primary display source is not found
  • Replaced console.log with logger.error for proper error logging
  • Removed duplicate window-all-closed event handler registration

Test plan

  • Code compiles successfully
  • No TypeScript errors
  • Null safety prevents potential runtime crash

🤖 Generated with Claude Code

- Fix potential null reference crash when primarySource is undefined in setDisplayMediaRequestHandler
- Replace console.log with logger.error for consistent error logging
- Remove duplicate window-all-closed event handler registration

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for agent-tars-docs canceled.

Name Link
🔨 Latest commit 3a287dd
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/698940d0a278200008138565

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for tarko canceled.

Name Link
🔨 Latest commit 3a287dd
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/698940d0ad484c00085bbd4a

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.

1 participant