leksy-editor 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leksy-editor",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Leksy Editor is an alternative to traditional WYSIWYG editors, designed primarily for creating mail templates, blogs, and documents without any content manipulation.",
5
5
  "main": "index.js",
6
6
  "directories": {
package/plugin.js CHANGED
@@ -899,7 +899,7 @@ const PLUGINS = {
899
899
 
900
900
  fileInput.addEventListener('click', async () => {
901
901
  let file = await core.handleFilePicker(MIMETYPE.VIDEO.split(','), 'video');
902
- if (MIMETYPE.VIDEO.includes(file.type)) {
902
+ if (file && MIMETYPE.VIDEO.includes(file?.type)) {
903
903
  const url = await core.uploadVideo(file);
904
904
  if (url) {
905
905
  const a = document.createElement('a');
@@ -932,7 +932,9 @@ const PLUGINS = {
932
932
 
933
933
  fileInput.addEventListener('click', async () => {
934
934
  let files = await core.handleFilePicker(["*"], 'attachment');
935
- core.onAttachment(files);
935
+ if (files) {
936
+ core.onAttachment(files);
937
+ }
936
938
 
937
939
  });
938
940
  fileInput.click();