-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Check text exists before accessing it #4395
Conversation
nonInteractiveContent | ||
/> | ||
</div> | ||
{hasMessage && quote.text && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this hide the quote when quote.kind === 'JustText'
? Because hasMessage
is defined as quote.kind === 'WithMessage'
.
And I think we need a comment for the quote.text &&
check, at least link the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now I check only for the text property to exist.
And I think we need a comment for the quote.text && check, at least link the issue
I think it is self explaining to check for the text property to exist before calling "slice" on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the thing is that the types say that it always exists.
nonInteractiveContent | ||
/> | ||
</div> | ||
{quote.text && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{quote.text && ( | |
{/* `quote.text` might be `undefined` due to | |
https://github.com/deltachat/deltachat-desktop/issues/4337#issuecomment-2473521298 */} | |
{quote.text && ( |
resolves #4337