Browse Source

Fix potential NRE in StatementBuilder.TryCatch

pull/1930/head
Siegfried Pammer 5 years ago
parent
commit
b953d6e8d0
  1. 2
      ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

2
ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

@ -361,8 +361,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -361,8 +361,8 @@ namespace ICSharpCode.Decompiler.CSharp
foreach (var handler in inst.Handlers) {
var catchClause = new CatchClause();
var v = handler.Variable;
catchClause.AddAnnotation(new ILVariableResolveResult(v, v.Type));
if (v != null) {
catchClause.AddAnnotation(new ILVariableResolveResult(v, v.Type));
if (v.StoreCount > 1 || v.LoadCount > 0 || v.AddressCount > 0) {
catchClause.VariableName = v.Name;
catchClause.Type = exprBuilder.ConvertType(v.Type);

Loading…
Cancel
Save