diff --git a/vendor/acra-storage/utils.js b/vendor/acra-storage/utils.js index 3e2e829..c804eb5 100644 --- a/vendor/acra-storage/utils.js +++ b/vendor/acra-storage/utils.js @@ -24,10 +24,25 @@ var utils = { }, getDevice: function(doc) { - if(doc.BUILD.MANUFACTURER) { - return doc.BUILD.MANUFACTURER + " " + doc.BUILD.BRAND + " " + doc.BUILD.MODEL; + if(doc.BUILD) { + if(doc.BUILD.MANUFACTURER) { + return doc.BUILD.MANUFACTURER + " " + doc.BUILD.BRAND + " " + doc.BUILD.MODEL; + } else { + return doc.BUILD.BRAND + " " + doc.BUILD.MODEL; + } } else { - return doc.BUILD.BRAND + " " + doc.BUILD.MODEL; + var value = ""; + if(doc.BRAND) { + value = doc.BRAND; + } + if(doc.PRODUCT) { + value += " " + doc.PRODUCT; + } + if(doc.PHONE_MODEL) { + value += " " + doc.MODEL; + } + + return value; } } };