diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2014-04-12 03:55:42 +0400 |
---|---|---|
committer | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2014-04-12 04:23:23 +0400 |
commit | c56601ce978a9246eba17e19f1e5c15f49e4f102 (patch) | |
tree | b302164a6d2b9b11703d8f6ce7d63ad2d880fe1e | |
parent | f4a15b8cee24cfeaa0f304589839243be51f5b44 (diff) |
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)]
-rw-r--r-- | Mono.Cecil/AssemblyReader.cs | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |