add default values for a better experience
authorMoritz Warning <moritzwarning@web.de>
Mon, 1 Jun 2020 20:27:08 +0000 (22:27 +0200)
committerMoritz Warning <moritzwarning@web.de>
Wed, 3 Jun 2020 10:13:17 +0000 (12:13 +0200)
index.js

index 92fb99395928a7019fd03215247e1b773c44294a..894f1a12ea562e14d35a531db68022682dd043cc 100644 (file)
--- a/index.js
+++ b/index.js
@@ -353,8 +353,8 @@ function init() {
       data.json().then(obj => {
         setupAutocompleteList($('models'), Object.keys(obj['models']), model => {
           if (model in obj['models']) {
-            var url = obj.url;
-            var code = obj.version_code;
+            var url = obj.url || 'unknown';
+            var code = obj.version_code || 'unknown';
             var date = obj.build_data || 'unknown';
             var mobj = obj['models'][model];
             updateImages(version, code, date, model, url, mobj, false);