Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 committed Mar 20, 2024
1 parent 4dca2b7 commit 928fb22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/oSnap/utils/safeImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ export function isJsonFile(file: File) {

export function getFileFromEvent(event: DragEvent | Event) {
let _file: File | undefined;

if (event instanceof DragEvent) {
_file = event.dataTransfer?.files?.[0];
}

if (event instanceof Event) {
if (event.target && event.target instanceof HTMLInputElement) {
_file = (event?.currentTarget as HTMLInputElement)?.files?.[0];
}
if (!_file) return;
Expand Down

0 comments on commit 928fb22

Please sign in to comment.