Fixing undefined exception when device properties not available

revert-70aa11f8
Rasika Perera 8 years ago
parent ccf4b6492c
commit f2af4bd078

@ -27,7 +27,7 @@ function onRequest(context) {
if (device) { if (device) {
var viewModel = {}; 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) { if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0) {
deviceInfo = parse(stringify(deviceInfo)); deviceInfo = parse(stringify(deviceInfo));
if (device.type == "ios") { if (device.type == "ios") {

Loading…
Cancel
Save