diff --git a/ui (gen4)/features/app.js b/ui (gen4)/features/app.js index 878560cd..cb77c42d 100755 --- a/ui (gen4)/features/app.js +++ b/ui (gen4)/features/app.js @@ -184,11 +184,14 @@ module.AppControl = core.ImageGridFeatures.Feature({ // XXX get this from the viewer... .replace('${VERSION}', this.version || 'gen4') .replace('${FILENAME}', - (img.name - || img.path.replace(/\.[\\\/]/, ''))) + img ? + (img.name || img.path.replace(/\.[\\\/]/, '')) + : '') .replace('${PATH}', - (img.base_path || '.') - +'/'+ img.path.replace(/\.[\\\/]/, '')) + img ? + (img.base_path || '.') + +'/'+ img.path.replace(/\.[\\\/]/, '') + : '') /* .replace('${DIR}', pathlib.dirname((img.base_path || '.') diff --git a/ui (gen4)/features/metadata.js b/ui (gen4)/features/metadata.js index 5e81ebda..b86febad 100755 --- a/ui (gen4)/features/metadata.js +++ b/ui (gen4)/features/metadata.js @@ -104,7 +104,7 @@ var MetadataReaderActions = actions.Actions({ var gid = this.data.getImage(image) var img = this.images && this.images[gid] - if(!image){ + if(!image || !img){ return } diff --git a/ui (gen4)/package.json b/ui (gen4)/package.json index 4678d180..877398a5 100755 --- a/ui (gen4)/package.json +++ b/ui (gen4)/package.json @@ -25,7 +25,7 @@ "glob": "^4.0.6", "guarantee-events": "^1.0.0", "promise": "^6.0.1", - "requirejs": "*", + "requirejs": "^2.1.23", "sharp": "^0.12.0" }, "preferGlobal": true,