Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gendarme/framework/Gendarme.Framework/BasicIgnoreList.cs4
-rw-r--r--gendarme/rules/Gendarme.Rules.Design/AttributeArgumentsShouldHaveAccessorsRule.cs6
2 files changed, 9 insertions, 1 deletions
diff --git a/gendarme/framework/Gendarme.Framework/BasicIgnoreList.cs b/gendarme/framework/Gendarme.Framework/BasicIgnoreList.cs
index 26717ab7..f1dc1fee 100644
--- a/gendarme/framework/Gendarme.Framework/BasicIgnoreList.cs
+++ b/gendarme/framework/Gendarme.Framework/BasicIgnoreList.cs
@@ -61,6 +61,10 @@ namespace Gendarme.Framework {
public void Add (string rule, IMetadataTokenProvider metadata)
{
+ if (rule is null) {
+ Console.Error.WriteLine("Attempted to add null rule");
+ return;
+ }
HashSet<IMetadataTokenProvider> list;
if (!ignore.TryGetValue (rule, out list)) {
list = new HashSet<IMetadataTokenProvider> ();
diff --git a/gendarme/rules/Gendarme.Rules.Design/AttributeArgumentsShouldHaveAccessorsRule.cs b/gendarme/rules/Gendarme.Rules.Design/AttributeArgumentsShouldHaveAccessorsRule.cs
index cc037aa3..1a803c97 100644
--- a/gendarme/rules/Gendarme.Rules.Design/AttributeArgumentsShouldHaveAccessorsRule.cs
+++ b/gendarme/rules/Gendarme.Rules.Design/AttributeArgumentsShouldHaveAccessorsRule.cs
@@ -126,7 +126,11 @@ namespace Gendarme.Rules.Design {
continue;
foreach (ParameterDefinition param in constructor.Parameters) {
- // pascal case it
+ // pascal case it
+ if (param.Name.Length == 0) {
+ Console.Error.WriteLine("Unexpected empty constructor parameter.\n Type: {0}\n Method: {1}", type.FullName, constructor);
+ continue;
+ }
string correspondingPropertyName = Char.ToUpper (param.Name [0], CultureInfo.InvariantCulture).ToString (CultureInfo.InvariantCulture) +
param.Name.Substring (1);
if (!allProperties.Contains (correspondingPropertyName)) {