From 364ab65b9225f1866dbb0a460b1fc555c02fb08a Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 30 Mar 2016 15:48:14 +0200 Subject: [PATCH] Link argument not specified in javascript call If the plugin's javascript "share" method is called without specifying the 3rd and 4th arguments, such as in: window.plugins.socialsharing.share('Message and subject', 'The subject') The condition: !"null".Equals(link) in the C# implementation is satisfied (link is null and not "null") and the method call is incorrectly interpreted as a "share link" intent, thus resulting in an exception being thrown when the following instruction is executed: shareLinkTask.LinkUri = new System.Uri(link, System.UriKind.Absolute) --- src/wp8/SocialSharing.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp8/SocialSharing.cs b/src/wp8/SocialSharing.cs index 1a165127..9d63b2f4 100644 --- a/src/wp8/SocialSharing.cs +++ b/src/wp8/SocialSharing.cs @@ -26,7 +26,7 @@ public void share(string jsonArgs) var files = JsonHelper.Deserialize(options[2]); var link = options[3]; - if (!"null".Equals(link)) + if (link != null && !"null".Equals(link)) { ShareLinkTask shareLinkTask = new ShareLinkTask(); shareLinkTask.Title = title; @@ -100,4 +100,4 @@ public class SMSMessageClass public string message { get; set; } } -} \ No newline at end of file +}