Fixing undefined exception when device properties not available

This commit is contained in:
Rasika Perera 2016-09-24 01:35:59 +05:30
parent ccf4b6492c
commit f2af4bd078

View File

@ -27,7 +27,7 @@ function onRequest(context) {
if (device) {
var viewModel = {};
var deviceInfo = device.properties.DEVICE_INFO;
var deviceInfo = (device.properties) ? device.properties.DEVICE_INFO : null;
if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0) {
deviceInfo = parse(stringify(deviceInfo));
if (device.type == "ios") {