Skip to content

Commit

Permalink
Merge pull request #3 from hoppler/master
Browse files Browse the repository at this point in the history
Fix for "Nullable object must have a value"
  • Loading branch information
perezdidac committed Oct 25, 2012
2 parents 58d73a3 + a59e78c commit b1eee32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/WhatsAppApi/Parser/FMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public bool Instantiated()

public FMessage.Key Key()
{
return new FMessage.Key(this.remote_jid, this.from_me.Value, this.id);
return new FMessage.Key(this.remote_jid, (!this.from_me.HasValue && this.from_me.Value), this.id);
}

public FMessage.Builder Key(FMessage.Key key)
Expand Down
5 changes: 5 additions & 0 deletions src/WhatsAppApi/Response/MessageRecvResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ private void TypeChat(ProtocolTreeNode messageNode, string tmpAttrFrom, string t
{
var tmpAttrName = itemNode.GetAttribute("name");
if (tmpAttrName != null)
{
builder.from_me = false;
builder.id = tmpAttrbId;
builder.remote_jid = tmpAttrFromJid;
builder.Key().serverNickname = tmpAttrName;
}
}
}
if (!builder.Timestamp().HasValue)
Expand Down

0 comments on commit b1eee32

Please sign in to comment.