Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit ae692d5

Browse files
committed
Fix #284 NotSupportedException thrown in NR CecilLoader
1 parent bede4f6 commit ae692d5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Libraries/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,13 @@ void AddSecurityAttributes(Mono.Collections.Generic.Collection<SecurityDeclarati
824824

825825
void AddSecurityAttributes(SecurityDeclaration secDecl, IList<IUnresolvedAttribute> targetCollection)
826826
{
827-
var blobSecDecl = new UnresolvedSecurityDeclarationBlob((int)secDecl.Action, secDecl.GetBlob());
827+
byte[] blob;
828+
try {
829+
blob = secDecl.GetBlob();
830+
} catch (NotSupportedException) {
831+
return; // https://github.com/icsharpcode/SharpDevelop/issues/284
832+
}
833+
var blobSecDecl = new UnresolvedSecurityDeclarationBlob((int)secDecl.Action, blob);
828834
targetCollection.AddRange(blobSecDecl.UnresolvedAttributes);
829835
}
830836
#endregion

0 commit comments

Comments
 (0)