Skip to content

fix: nil check in renderCalendarInvite#1023

Merged
andrinoff merged 1 commit intofloatpane:masterfrom
vedparkasharya:fix-nil-check-calendar
Apr 27, 2026
Merged

fix: nil check in renderCalendarInvite#1023
andrinoff merged 1 commit intofloatpane:masterfrom
vedparkasharya:fix-nil-check-calendar

Conversation

@vedparkasharya
Copy link
Copy Markdown
Contributor

@vedparkasharya vedparkasharya commented Apr 26, 2026

What?

Adds a nil check on the calendar event parameter in renderCalendarInvite to prevent potential runtime panics when the event data is unexpectedly nil.

Why?

Without this check, calling renderCalendarInvite with a nil event could cause a crash. This fix ensures safe handling of nil calendar events, improving robustness.

Fixes #883

renderCalendarInvite() accessed event.Summary, event.Start, and other
fields without checking if the event parameter was nil. If ParseICS()
returns a successfully parsed calendar with nil event fields, this causes
a panic on nil pointer dereference.

Changes:
- Added nil check at the top of renderCalendarInvite()
- Returns empty string if event is nil, preventing panic

This handles malformed ICS attachments (e.g., VEVENT with no DTSTART)
gracefully instead of crashing.

Fixes #883
@vedparkasharya vedparkasharya requested a review from a team as a code owner April 26, 2026 10:42
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @vedparkasharya! Please fix the following issues with your PR:

  • Title: Is too long (67 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@github-actions github-actions Bot added the bug Something isn't working label Apr 26, 2026
@andrinoff
Copy link
Copy Markdown
Member

@vedparkasharya make the changes given by the bot.

@vedparkasharya vedparkasharya changed the title fix: add nil check on calendar event in renderCalendarInvite (#883) fix: nil check in renderCalendarInvite Apr 26, 2026
@vedparkasharya
Copy link
Copy Markdown
Contributor Author

Hi @andrinoff, thanks for the reminder! I've updated the PR to address the bot's feedback:

  • Shortened the title to under 40 characters
  • Added the required ## What? and ## Why? sections to the PR body

Please let me know if anything else is needed. 👍

@floatpanebot floatpanebot dismissed their stale review April 26, 2026 23:07

Formatting issues have been resolved. Thank you!

@vedparkasharya
Copy link
Copy Markdown
Contributor Author

Hi @andrinoff and maintainers,

I've updated the PR to address the bot's feedback:

  • Shortened the title to under 40 characters
  • Added the required ## What? and ## Why? sections to the PR body

Please let me know if anything else is needed. Thanks!

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@LeaWhoCodes
Copy link
Copy Markdown
Member

/approve

Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Approved on behalf of @LeaWhoCodes via /approve command.

@andrinoff andrinoff merged commit 100b75b into floatpane:master Apr 27, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Missing nil check on calendar event in renderCalendarInvite

5 participants