[rygel] core: Correct error on missing 'Elements' node
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Correct error on missing 'Elements' node
- Date: Wed, 2 Jun 2010 12:12:21 +0000 (UTC)
commit bdf0d1518960620cee668c772ab6c2f733b497f4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed May 26 23:52:34 2010 +0300
core: Correct error on missing 'Elements' node
Throw correct error on missing 'Elements' node in CreateObject action.
src/rygel/rygel-content-directory.vala | 1 +
src/rygel/rygel-item-creator.vala | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala
index 52857b2..4fc0215 100644
--- a/src/rygel/rygel-content-directory.vala
+++ b/src/rygel/rygel-content-directory.vala
@@ -30,6 +30,7 @@ using Gee;
*/
public errordomain Rygel.ContentDirectoryError {
NO_SUCH_OBJECT = 701,
+ BAD_METADATA = 712,
RESTRICTED_PARENT = 713,
CANT_PROCESS = 720,
INVALID_ARGS = 402
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 2d863c3..e656d2e 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -91,7 +91,12 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
this.action.get ("ContainerID", typeof (string), out this.container_id,
"Elements", typeof (string), out this.elements);
- if (this.container_id == null || this.elements == null) {
+ if (this.elements == null) {
+ throw new ContentDirectoryError.BAD_METADATA (
+ _("'Elements' argument missing."));
+ }
+
+ if (this.container_id == null) {
// Sorry we can't do anything without ContainerID
throw new ContentDirectoryError.NO_SUCH_OBJECT (
_("No such object"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]