Fix undefined issues
Fix undefined issues

TypeError: Cannot read property 'name' of undefined
TypeError: Cannot read property 'code' of undefined
appium/appium,Sw0rdstream/appium,appium/appium,appium/appium,appium/appium,appium/appium,appium/appium