Skip to content

Commit

Permalink
chore: add content check before running convert function
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Dec 4, 2023
1 parent ee889b3 commit 8d520ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/ui-services/src/Import/Importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ export class Importer {
continue
}

const content = await readFileAsText(file)

if (!converter.isContentValid(content)) {
throw new Error('Content is not valid')
}

return await converter.convert(file, {
createNote: this.createNote,
createTag: this.createTag,
Expand Down

0 comments on commit 8d520ba

Please sign in to comment.