diff --git a/lime/_macros/AssetsMacro.hx b/lime/_macros/AssetsMacro.hx index fd2cdc57f..00219e911 100644 --- a/lime/_macros/AssetsMacro.hx +++ b/lime/_macros/AssetsMacro.hx @@ -11,6 +11,7 @@ import haxe.macro.Type; #if (macro && !display) import sys.io.File; +import sys.FileSystem; #end @@ -162,12 +163,18 @@ class AssetsMacro { var path = filePath; - if (!sys.FileSystem.exists(filePath)) { + if (!FileSystem.exists (filePath)) { path = Context.resolvePath (filePath); } + if (path == null || path == null || !FileSystem.exists (path) || FileSystem.isDirectory (path)) { + + return null; + + } + var bytes = File.getBytes (path); var resourceName = "__ASSET__" + metaName + "_" + (classType.pack.length > 0 ? classType.pack.join ("_") + "_" : "") + classType.name;