[rygel/rygel-0-18] media-export: Fix crash on item removal
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-18] media-export: Fix crash on item removal
- Date: Fri, 9 Aug 2013 08:10:50 +0000 (UTC)
commit 69931ab6328134ccc8df7aefe26dd5d0202bd260
Author: Jens Georg <jensg openismus com>
Date: Mon Aug 5 16:53:06 2013 +0200
media-export: Fix crash on item removal
MediaCache.get_object can return null if the object wasn't found in the
cache. On certain conditions this can happen while uploading (removal
queue vs. manual remove from client). Take this into account and just
warn instead of crash.
This isn't the proper fix for the issue but at least it stopps Rygel from
crashing.
https://bugzilla.gnome.org/show_bug.cgi?id=702633
.../rygel-media-export-writable-db-container.vala | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-writable-db-container.vala
b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
index 023d3be..b93f855 100644
--- a/src/plugins/media-export/rygel-media-export-writable-db-container.vala
+++ b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
@@ -94,8 +94,11 @@ internal class Rygel.MediaExport.WritableDbContainer : TrackableDbContainer,
public async void remove_item (string id, Cancellable? cancellable)
throws Error {
var object = this.media_db.get_object (id);
-
- yield this.remove_child_tracked (object);
+ if (object != null) {
+ yield this.remove_child_tracked (object);
+ } else {
+ warning (_("Could not find object %d in cache"), id);
+ }
}
public async void remove_container (string id, Cancellable? cancellable)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]