Skip to content

Commit 8e7e018

Browse files
authored
Merge pull request #3474 from ds5678/fix-null-reference-exception-when-writing-resource-files
Fix null reference exception when writing resource files
2 parents aff9649 + 9827405 commit 8e7e018

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ICSharpCode.Decompiler/CSharp/ProjectDecompiler/WholeProjectDecompiler.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ protected virtual IEnumerable<ProjectItemInfo> WriteResourceFilesInProject(Metad
337337
foreach (var r in module.Resources.Where(r => r.ResourceType == ResourceType.Embedded))
338338
{
339339
Stream stream = r.TryOpenStream();
340+
if (stream == null)
341+
continue;
342+
340343
stream.Position = 0;
341344

342345
if (r.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase))

0 commit comments

Comments
 (0)