[rygel] mpris: Don't crash on faulty MPRIS implementation
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] mpris: Don't crash on faulty MPRIS implementation
- Date: Tue, 9 Oct 2012 19:54:52 +0000 (UTC)
commit 3f3839179ef578a088d1167a48dbd2e277babc23
Author: Jens Georg <jensg openismus com>
Date: Tue Oct 9 13:26:52 2012 +0200
mpris: Don't crash on faulty MPRIS implementation
src/plugins/mpris/rygel-mpris-plugin.vala | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/mpris/rygel-mpris-plugin.vala b/src/plugins/mpris/rygel-mpris-plugin.vala
index 587e037..6e45700 100644
--- a/src/plugins/mpris/rygel-mpris-plugin.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin.vala
@@ -32,8 +32,8 @@ public class Rygel.MPRIS.Plugin : Rygel.MediaRendererPlugin {
public PlayerProxy actual_player;
- public string[] mime_types;
- public string[] protocols;
+ public string[]? mime_types;
+ public string[]? protocols;
public Plugin (string service_name,
PlayerProxy actual_player) {
@@ -54,7 +54,11 @@ public class Rygel.MPRIS.Plugin : Rygel.MediaRendererPlugin {
return new MPRIS.Player (this);
}
- private string[] schemes_to_protocols (string[] schemes) {
+ private string[]? schemes_to_protocols (string[] schemes) {
+ if (schemes == null) {
+ return null;
+ }
+
var protocols = new string[schemes.length];
for (var i = 0; i < schemes.length; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]