1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-05 17:40:26 +00:00

Fix deletion of media hyphae with no text

This commit is contained in:
Timur Ismagilov 2022-05-07 01:03:20 +05:00
parent 72a3e20ee7
commit ce6447fea4

View File

@ -18,7 +18,11 @@ func Delete(u *user.User, h hyphae.ExistingHypha) error {
originalText, _ := FetchTextFile(h)
switch h := h.(type) {
case *hyphae.MediaHypha:
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
if h.HasTextFile() {
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
} else {
hop.WithFilesRemoved(h.MediaFilePath())
}
case *hyphae.TextualHypha:
hop.WithFilesRemoved(h.TextFilePath())
}