Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TypeError undefined is not an object (evaluating 'this.features.inbound_emails') #9563

Merged
merged 1 commit into from
May 29, 2024

Conversation

iamsivin
Copy link
Member

Pull Request Template

Description

Cause of this issue
I tried replicating the issue by toggling the feature flags from the super admin, but it didn't work. The error TypeError: undefined, is not an object (evaluating 'this.features.inbound_emails'). It's because this.features is undefined when featureInboundEmailEnabled is called. This can happen if this.features is not properly initialized before this method is accessed. The features are set on mounted.

Solution
To resolve this issue, you should ensure that this.features is defined before any computations or methods that rely on it are executed. So, I added a check in the featureInboundEmailEnabled method to handle cases where features might be undefined.

Fixes https://linear.app/chatwoot/issue/CW-3341/typeerror-undefined-is-not-an-object-evaluating-thisfeaturesinbound

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@iamsivin iamsivin merged commit b31be37 into develop May 29, 2024
14 of 15 checks passed
@iamsivin iamsivin deleted the fix/CW-3341 branch May 29, 2024 16:01
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants