Skip to content

Commit

Permalink
Fix exception when creating callback from SteamUserStats.GetLeaderboa…
Browse files Browse the repository at this point in the history
…rdEntries.

Fixes #421
  • Loading branch information
yaakov-h committed Jul 31, 2017
1 parent 32e3b73 commit e48c5ff
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ internal LeaderboardEntry( CMsgClientLBSGetLBEntriesResponse.Entry entry )

var details = new List<int>();

using ( var stream = new MemoryStream( entry.details ) )
if ( entry.details != null )
{
while ( ( stream.Length - stream.Position ) >= sizeof( int ) )
using ( var stream = new MemoryStream( entry.details ) )
{
details.Add( stream.ReadInt32() );
while ( ( stream.Length - stream.Position ) >= sizeof( int ) )
{
details.Add( stream.ReadInt32() );
}
}
}

Expand Down

0 comments on commit e48c5ff

Please sign in to comment.