Author: nestor
Date: 2007-10-19 07:14:45 -0400 (Fri, 19 Oct 2007)
New Revision: 87819
Modified:
trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog
trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/FloatComparisonRule.cs
Log:
2007-10-19 Nestor Salceda <[EMAIL PROTECTED]>
* FloatComparisonRule.cs: Before get the instructions from the method
body, the existence of method body should be checked. This
fixes the NullReferenceException.
Modified: trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog
===================================================================
--- trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog
2007-10-19 11:09:16 UTC (rev 87818)
+++ trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog
2007-10-19 11:14:45 UTC (rev 87819)
@@ -1,5 +1,11 @@
2007-10-19 Nestor Salceda <[EMAIL PROTECTED]>
+ * FloatComparisonRule.cs: Before get the instructions from the method
+ body, the existence of method body should be checked. This fixes the
+ NullReferenceException.
+
+2007-10-19 Nestor Salceda <[EMAIL PROTECTED]>
+
* CallingEqualsWithNullArgRule.cs: Before get the instructions from a
method body, the existence of method body should be checked. Perhaps
exists better solutions for this case, but this solution fixes the
Modified:
trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/FloatComparisonRule.cs
===================================================================
---
trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/FloatComparisonRule.cs
2007-10-19 11:09:16 UTC (rev 87818)
+++
trunk/cecil/gendarme/rules/Gendarme.Rules.Correctness/FloatComparisonRule.cs
2007-10-19 11:14:45 UTC (rev 87819)
@@ -42,6 +42,9 @@
public MessageCollection CheckMethod(MethodDefinition method,
Runner runner)
{
MessageCollection messageCollection = new
MessageCollection();
+
+ if (!method.HasBody)
+ return null;
foreach (Instruction instruction in
method.Body.Instructions)
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches