Skip to content

fix: code editor null value crash - #7039

Merged
sid-bruno merged 1 commit into
usebruno:mainfrom
pooja-bruno:fix/code-editor-null-value-crash
Feb 5, 2026
Merged

sid-bruno merged 1 commit into
usebruno:mainfrom
pooja-bruno:fix/code-editor-null-value-crash

Conversation

@pooja-bruno

@pooja-bruno pooja-bruno commented Feb 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

JIRA

Fixed an issue where the app crashed when clearing all content in the documentation editor during autosave specifically in Yaml files.

This happens in yml files since docs can be null in yaml and that isn't handled in the codeeditor right nwo

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
Screen.Recording.2026-02-04.at.12.23.55.PM.mov

Summary by CodeRabbit

  • Bug Fixes
    • Improved code editor stability by properly handling null or undefined values while maintaining cursor position during updates.

@coderabbitai

coderabbitai Bot commented Feb 4, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

CodeEditor/index.js now uses the nullish coalescing operator to provide an empty string fallback when updating the editor value, ensuring null or undefined values default to an empty string instead of being passed directly to setValue().

Changes

Cohort / File(s) Summary
CodeEditor Value Handling
packages/bruno-app/src/components/CodeEditor/index.js
Added nullish coalescing operator (??) when setting editor value to default null/undefined to empty string, preventing potential issues with CodeMirror.setValue().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

A nullish coalesce saves the day, 🎯
Empty strings show the editor's way,
No more undefined in the mix,
Just one small operator fix! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: handling null values in the code editor that were causing crashes during autosave.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sid-bruno
sid-bruno merged commit 1443fb0 into usebruno:main Feb 5, 2026
5 of 6 checks passed
bijin-bruno pushed a commit that referenced this pull request Feb 11, 2026
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants