Browse Source

Fixed tests

Nikita Tsukanov 10 years ago
parent
commit
f5e8426371
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/Shared/PlatformSupport/AssetLoader.cs

+ 6 - 1
src/Shared/PlatformSupport/AssetLoader.cs

@@ -44,7 +44,8 @@ namespace Perspex.Shared.PlatformSupport
         {
             if (assembly == null)
                 assembly = Assembly.GetEntryAssembly();
-            _defaultAssembly = new AssemblyDescriptor(assembly);
+            if (assembly != null)
+                _defaultAssembly = new AssemblyDescriptor(assembly);
         }
     
 
@@ -99,6 +100,10 @@ namespace Perspex.Shared.PlatformSupport
                 if (qs.ContainsKey("assembly"))
                     asm = GetAssembly(qs["assembly"]);
 
+                if (asm == null && _defaultAssembly == null)
+                    throw new ArgumentException(
+                        "No defaultAssembly, entry assembly or explicit assembly specified, don't know where to look up for the resource, try specifiyng assembly explicitly");
+
                 IAssetDescriptor rv;
                 asm.Resources.TryGetValue(uri.AbsolutePath, out rv);
                 return rv;