aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-29 14:17:07 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-12-29 14:17:07 +0100
commit0530c5d95fde2b77fcae29a7cfa08bb75da4f5a5 (patch)
tree298681209188093ff384c19a0cf3ddc1f03d2616
parentce2e58b6bcdef7616d5426f3310ab09cdea92f32 (diff)
downloadgallery-0530c5d95fde2b77fcae29a7cfa08bb75da4f5a5.tar.gz
gallery-0530c5d95fde2b77fcae29a7cfa08bb75da4f5a5.tar.xz
gallery-0530c5d95fde2b77fcae29a7cfa08bb75da4f5a5.zip
Fix /api/orphans with removed parent nodes
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index 0eb7382..3afe941 100644
--- a/main.go
+++ b/main.go
@@ -658,7 +658,9 @@ func getOrphanReplacement(webPath string) (*webOrphanImage, error) {
}
parent, err := idForDirectoryPath(tx, path[:len(path)-1], false)
- if err != nil {
+ if errors.Is(err, sql.ErrNoRows) {
+ return nil, nil
+ } else if err != nil {
return nil, err
}