Add guard against null

This commit is contained in:
Joshua Granick
2015-09-01 10:06:46 -07:00
parent 4a0961afd6
commit 14d1ae7abe

View File

@@ -69,7 +69,10 @@ class DefaultAssetLibrary extends AssetLibrary {
type.set (id, AssetType.$$upper(::type::)); type.set (id, AssetType.$$upper(::type::));
::end::::end:: ::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) { if (assetsPrefix != null) {
for (k in path.keys()) { for (k in path.keys()) {
path.set(k, assetsPrefix + path[k]); path.set(k, assetsPrefix + path[k]);