From aa2ce92148cd24ac8defa427520fbbe6eba2039b Mon Sep 17 00:00:00 2001 From: lidgren Date: Mon, 13 Jan 2014 08:06:37 +0000 Subject: [PATCH] ReadAllFields and ReadAllProperties now throws ArgumentNullException --- Lidgren.Network/NetBuffer.Read.Reflection.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Lidgren.Network/NetBuffer.Read.Reflection.cs b/Lidgren.Network/NetBuffer.Read.Reflection.cs index b34fbec..03838b2 100644 --- a/Lidgren.Network/NetBuffer.Read.Reflection.cs +++ b/Lidgren.Network/NetBuffer.Read.Reflection.cs @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 Michael Lidgren + /* Copyright (c) 2010 Michael Lidgren Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without @@ -37,7 +37,8 @@ namespace Lidgren.Network public void ReadAllFields(object target, BindingFlags flags) { if (target == null) - return; + throw new ArgumentNullException("target"); + Type tp = target.GetType(); FieldInfo[] fields = tp.GetFields(flags); @@ -76,8 +77,6 @@ namespace Lidgren.Network if (target == null) throw new ArgumentNullException("target"); - if (target == null) - return; Type tp = target.GetType(); PropertyInfo[] fields = tp.GetProperties(flags); @@ -100,4 +99,4 @@ namespace Lidgren.Network } } } -} +} \ No newline at end of file