[rygel] core: Use correct error in CreateObject
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Use correct error in CreateObject
- Date: Wed, 18 Jan 2012 17:19:48 +0000 (UTC)
commit e6be7e48801f095bf13426abfa0329a113007d74
Author: Jens Georg <mail jensge org>
Date: Mon Jan 9 19:05:38 2012 +0100
core: Use correct error in CreateObject
If CreateObject is called with an id that describes an item instead of
a container ContentDirectory:2 spec says that the error should be 701
(No such object) instead of 713 (Restricted parent)
src/rygel/rygel-item-creator.vala | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index d6c867e..51b9040 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -283,11 +283,10 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
(this.container_id, this.cancellable);
}
- if (media_object == null) {
+ if (media_object == null || !(media_object is MediaContainer)) {
throw new ContentDirectoryError.NO_SUCH_OBJECT
(_("No such object"));
- } else if (!(media_object is MediaContainer) ||
- !(OCMFlags.UPLOAD in media_object.ocm_flags)) {
+ } else if (!(OCMFlags.UPLOAD in media_object.ocm_flags)) {
throw new ContentDirectoryError.RESTRICTED_PARENT
(_("Object creation in %s not allowed"),
media_object.id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]