src/strip.vala
authorAlan Knowles <alan@roojs.com>
Fri, 29 Jun 2018 07:31:31 +0000 (15:31 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 29 Jun 2018 07:31:31 +0000 (15:31 +0800)
src/strip.vala

index c3fd8fc..5b55d52 100644 (file)
@@ -368,6 +368,17 @@ public class Strip : GLib.Object {
                return;
        }
        
+       // initialize it with known data..
+       // that should wipe out dupes.
+       var matches = this.execute("SELECT count(id) FROM Attachment WHERE id = %d".printf(
+                       int.parse(sid)));  
+
+               if (matches=="0") {      
+                  GLib.error("Failed to find id  :%s", sid);
+                  return;
+               }
+       
+       
        // initialize it with known data..
        // that should wipe out dupes.
        var filesize = this.execute("SELECT filesize FROM Attachment WHERE id = %d".printf(