-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
OnBlur throws exceptions if the notetype is snippet -> Fixes #1962 #1963
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
OnBlur throws exceptions if the notetype is snippet -> Fixes #1962 #1963
Conversation
sosukesuzuki
left a comment
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.
Please confirm my review!
| if (attachmentsInNote) { | ||
| for (let i = 0; i < attachmentsInNote.length; i++) { | ||
| attachmentsInNoteOnlyFileNames.push(attachmentsInNote[i].replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + escapeStringRegexp(path.sep) + noteKey + escapeStringRegexp(path.sep), 'g'), '')) | ||
| if (storageKey && noteKey && markdownContent !== null && typeof markdownContent !== 'undefined') { |
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.
please write like below:
if (storageKey != null && noteKey != null && markdownContent != null)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.
you are right and i've fixed the issue like you suggested
|
@sosukesuzuki i've changed it like you said ;) |
| if (attachmentsInNote) { | ||
| for (let i = 0; i < attachmentsInNote.length; i++) { | ||
| attachmentsInNoteOnlyFileNames.push(attachmentsInNote[i].replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + escapeStringRegexp(path.sep) + noteKey + escapeStringRegexp(path.sep), 'g'), '')) | ||
| if (storageKey != null && noteKey != null && markdownContent != null) { |
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.
It might be better for this to be able to reduce nesting, like below:
if (storageKey == null || noteKey == null || markdownContent == null) returnThere 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.
done
| for (let i = 0; i < attachmentsInNote.length; i++) { | ||
| attachmentsInNoteOnlyFileNames.push(attachmentsInNote[i].replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + escapeStringRegexp(path.sep) + noteKey + escapeStringRegexp(path.sep), 'g'), '')) | ||
| } | ||
| if (storageKey == null || noteKey == null || markdownContent == null) { |
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.
{} is unnecessary.please write like below:
if (storageKey == null || noteKey == null || markdownContent == null) return
I've only inserted an additional IF..