From 8951660393dd4babc235fd291469e2fb1dc4a22d Mon Sep 17 00:00:00 2001 From: daserge Date: Thu, 21 Apr 2016 15:40:33 +0300 Subject: [PATCH] CB-11132 Fix Error: Cannot read property 'match' of undefined in cordova-android emulator.js --- bin/templates/cordova/lib/emulator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js index 600c7da6..bd85dcd4 100644 --- a/bin/templates/cordova/lib/emulator.js +++ b/bin/templates/cordova/lib/emulator.js @@ -70,7 +70,7 @@ module.exports.list_images = function() { i++; img_obj['path'] = response[i].split('Path: ')[1].replace('\r', ''); } - if (response[i + 1].match(/\(API\slevel\s/) || response[i + 2].match(/\(API\slevel\s/)) { + if (response[i + 1].match(/\(API\slevel\s/) || (response[i + 2] && response[i + 2].match(/\(API\slevel\s/))) { i++; var secondLine = response[i + 1].match(/\(API\slevel\s/) ? response[i + 1] : ''; img_obj['target'] = (response[i] + secondLine).split('Target: ')[1].replace('\r', '');