From c56601ce978a9246eba17e19f1e5c15f49e4f102 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Sat, 12 Apr 2014 01:55:42 +0200 Subject: Add a null-check to fix a regression in 4de92b7. The regression (NRE) occurs if null is passed as the argument to an attribute constructor taking a type: [SomeAttribute (null)] --- Mono.Cecil/AssemblyReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index 3e1cc30..569475b 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -3119,7 +3119,7 @@ namespace Mono.Cecil { public TypeReference ReadTypeReference () { string s = ReadUTF8String (); - if (s.IndexOf ('\\') != -1) + if (s != null && s.IndexOf ('\\') != -1) s = UnescapeTypeName (s); return TypeParser.ParseType (reader.module, s); } -- cgit v1.2.3