Skip to content

Commit

Permalink
fix unattended consequence of previous commit, 1.0.5.28
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Nov 4, 2014
1 parent 0875412 commit eebcdd3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions NBitcoin/BitcoinStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ public void ReadWrite(ref bool data)

public void ReadWrite<T>(ref T data) where T : IBitcoinSerializable
{
if(data == null && !Serializing)
data = Activator.CreateInstance<T>();
if(data != null)
data.ReadWrite(this);
var obj = data;
if(obj == null)
obj = Activator.CreateInstance<T>();
obj.ReadWrite(this);
if(!Serializing)
data = obj;
}

public void ReadWrite<T>(ref List<T> list) where T : IBitcoinSerializable, new()
Expand Down

0 comments on commit eebcdd3

Please sign in to comment.