[rygel] server: Fix crash when import is cancelled



commit 6e90efef87b2246d63c682b0a3a9d761a75d7e10
Author: Jens Georg <mail jensge org>
Date:   Sun Aug 10 11:51:31 2014 +0200

    server: Fix crash when import is cancelled
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734302

 src/librygel-server/rygel-import-resource.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-server/rygel-import-resource.vala b/src/librygel-server/rygel-import-resource.vala
index f76aa7a..ea3f4d4 100644
--- a/src/librygel-server/rygel-import-resource.vala
+++ b/src/librygel-server/rygel-import-resource.vala
@@ -218,6 +218,8 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine {
                 this.action.return_error (715, phrase);
             }
         }
+
+        this.action = null;
     }
 
     private void got_chunk_cb (Message message, Buffer buffer) {
@@ -265,7 +267,13 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine {
                 this.status = TransferStatus.ERROR;
 
                 var phrase = Status.get_phrase (message.status_code);
-                this.action.return_error (714, phrase);
+                warning (_("Failed to import file from %s: %s"),
+                         this.source_uri,
+                         phrase);
+
+                if (this.action != null) {
+                    this.action.return_error (714, phrase);
+                }
             }
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]