Skip to content

Commit

Permalink
Link argument not specified in javascript call
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
LucaBlackDragon committed Mar 30, 2016
1 parent c3ca810 commit 364ab65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp8/SocialSharing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void share(string jsonArgs)
var files = JsonHelper.Deserialize<string[]>(options[2]);
var link = options[3];

if (!"null".Equals(link))
if (link != null && !"null".Equals(link))
{
ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = title;
Expand Down Expand Up @@ -100,4 +100,4 @@ public class SMSMessageClass
public string message { get; set; }
}

}
}

0 comments on commit 364ab65

Please sign in to comment.