swak / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

NullPointer thrown on Property with no Setter #169

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Perform a incomingMessage.ReadAllProperties on a object that has a property 
with no Setter.

What is the expected output? What do you see instead?
I don't expect an exception to be thrown because it can't set that property.  
It throws a NullPointer on the Setter.

What version of the product are you using? On what operating system?
Latest.

Please provide any additional information below.
Line 96-97 in NetBuffer.Read.Reflection.cs
                    MethodInfo setMethod = fi.GetSetMethod((flags & BindingFlags.NonPublic) == BindingFlags.NonPublic);
                    setMethod.Invoke(target, new object[] { value });

Original issue reported on code.google.com by kirkmacm...@gmail.com on 3 Aug 2014 at 2:22

GoogleCodeExporter commented 8 years ago
It is a easy fix just checking if the setMethod is null.

Original comment by kirkmacm...@gmail.com on 3 Aug 2014 at 2:23

GoogleCodeExporter commented 8 years ago
Fixed in rev 363

Original comment by lidg...@gmail.com on 3 Aug 2014 at 2:26