Skip to content

Fix AttributeError in notification routing when subchannel is None#33

Merged
mrunalhirve128 merged 1 commit intomainfrom
users/mrunalhirve/FixForNotifications
Nov 8, 2025
Merged

Fix AttributeError in notification routing when subchannel is None#33
mrunalhirve128 merged 1 commit intomainfrom
users/mrunalhirve/FixForNotifications

Conversation

@mrunalhirve128
Copy link
Contributor

The notification routing logic was throwing AttributeError: 'NoneType' object has no attribute 'lower' when processing notifications where ch.sub_channel was None.

The original code checked if ch exists but didn't verify that ch.sub_channel itself was not None before calling .lower()

The fix ensures .lower() is always called on a string (either the actual value or an empty string), never on None

Copilot AI review requested due to automatic review settings November 8, 2025 02:13
@mrunalhirve128 mrunalhirve128 requested a review from a team as a code owner November 8, 2025 02:13
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 refactors code in the agent_notification.py file to make it more concise and improve null safety.

  • Consolidates multi-line variable assignments into single-line expressions with inline .lower() calls
  • Adds explicit null checking for ch.sub_channel to prevent potential AttributeError when the value is None

@mrunalhirve128 mrunalhirve128 merged commit 241739a into main Nov 8, 2025
14 checks passed
@pontemonti pontemonti deleted the users/mrunalhirve/FixForNotifications branch December 5, 2025 17:14
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.

2 participants