Skip to content

Commit

Permalink
Fix BamlDecompiler.Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Jul 1, 2018
1 parent a6e5b82 commit 60726e9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ILSpy.BamlDecompiler.Tests/BamlTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading;
using System.Xml.Linq;
using ICSharpCode.Decompiler.Tests.Helpers;
using ICSharpCode.Decompiler.Util;
using Mono.Cecil;
using NUnit.Framework;

Expand Down Expand Up @@ -142,14 +143,14 @@ Stream LoadBaml(Resource res, string name)
if (er != null) {
Stream s = er.GetResourceStream();
s.Position = 0;
ResourceReader reader;
ResourcesFile resources;
try {
reader = new ResourceReader(s);
resources = new ResourcesFile(s);
} catch (ArgumentException) {
return null;
}
foreach (DictionaryEntry entry in reader.Cast<DictionaryEntry>().OrderBy(e => e.Key.ToString())) {
if (entry.Key.ToString() == name) {
foreach (var entry in resources.OrderBy(e => e.Key)) {
if (entry.Key == name) {
if (entry.Value is Stream)
return (Stream)entry.Value;
if (entry.Value is byte[])
Expand Down

0 comments on commit 60726e9

Please sign in to comment.