From e3e1671d0e8cce0522ed5bb39f87049cb4b157c9 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Tue, 4 Feb 2025 10:50:57 +0530 Subject: [PATCH] fix: add et null check to prevent crash --- src/internal/function.go | 2 +- src/internal/model.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/function.go b/src/internal/function.go index 1ceadbb2..327c787c 100644 --- a/src/internal/function.go +++ b/src/internal/function.go @@ -358,7 +358,7 @@ func (m *model) returnMetaData() { return } - if Config.Metadata && checkIsSymlinked.Mode()&os.ModeSymlink == 0 { + if Config.Metadata && checkIsSymlinked.Mode()&os.ModeSymlink == 0 && et != nil { fileInfos := et.ExtractMetadata(filePath) diff --git a/src/internal/model.go b/src/internal/model.go index ec8503bb..ad944807 100644 --- a/src/internal/model.go +++ b/src/internal/model.go @@ -450,7 +450,7 @@ func (m *model) getFilePanelItems() { // the path in state direcotory func (m *model) quitSuperfile() { // close exiftool session - if Config.Metadata { + if Config.Metadata && et != nil { et.Close() } // cd on quit