Backend: Fix nil pointer panic in RelatedFiles() #454
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
d53084b095
commit
e0eaa72843
1 changed files with 4 additions and 2 deletions
|
@ -313,12 +313,14 @@ func (m *MediaFile) RelatedFiles(stripSequence bool) (result RelatedFiles, err e
|
|||
result.Main = f
|
||||
} else if f.IsHEIF() {
|
||||
result.Main = f
|
||||
} else if f.IsJpeg() && len(result.Main.FileName()) > len(f.FileName()) {
|
||||
result.Main = f
|
||||
} else if f.IsImageOther() {
|
||||
result.Main = f
|
||||
} else if f.IsVideo() {
|
||||
result.Main = f
|
||||
} else if result.Main != nil && f.IsJpeg() {
|
||||
if result.Main.IsJpeg() && len(result.Main.FileName()) > len(f.FileName()) {
|
||||
result.Main = f
|
||||
}
|
||||
}
|
||||
|
||||
result.Files = append(result.Files, f)
|
||||
|
|
Loading…
Reference in a new issue