From 14d1ae7abe4e71c59363545b5ce90af77085b34d Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 1 Sep 2015 10:06:46 -0700 Subject: [PATCH] Add guard against null --- templates/haxe/DefaultAssetLibrary.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index fe821b5ac..c418e1b85 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -69,7 +69,10 @@ class DefaultAssetLibrary extends AssetLibrary { type.set (id, AssetType.$$upper(::type::)); ::end::::end:: - var assetsPrefix = ApplicationMain.config.assetsPrefix; + var assetsPrefix = null; + if (ApplicationMain.config != null && Reflect.hasField (ApplicationMain.config, "assetsPrefix")) { + assetsPrefix = ApplicationMain.config.assetsPrefix; + } if (assetsPrefix != null) { for (k in path.keys()) { path.set(k, assetsPrefix + path[k]);