src/strip.vala
authorAlan Knowles <alan@roojs.com>
Fri, 4 May 2018 05:29:22 +0000 (13:29 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 4 May 2018 05:29:22 +0000 (13:29 +0800)
src/strip.vala

index c998354..e47fcf3 100644 (file)
@@ -446,7 +446,12 @@ public class Strip : GLib.Object {
                
                }
                file_id =  row[0];
-                       
+               if (int.parse(file_id) < 1) {
+                       GLib.debug("ERROR - CALL to attachment_init failed - returned 0?");
+               Posix.unlink(fn);               
+               return;
+               
+               }
                        
        
                GLib.debug("fn = %s, m5=%s, id= %s", filename, mime_type, this.active_message_id);
@@ -468,17 +473,9 @@ public class Strip : GLib.Object {
 
                                 
  
-                     
-                     
-                     )
-                       );
                        this.used_space_after += file_size;
                        
-                       var file_id_real = this.mysql.insert_id();
-                       GLib.debug("Got file_id = %d\n", (int)file_id_real);                    
-                       if (file_id_real == 0) {
-                               GLib.Process.exit(1);
-                       }
+                        
                        file_id = "%d".printf((int)file_id_real);