Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

device_info not found at pokeio.js line 147 #213

Closed cpainchaud closed 8 years ago

cpainchaud commented 8 years ago

PR #208 actually generates error because it's defined nowhere : it was supposed to be an optional field according to the PR but its absence is not checked and generates an issue

cpainchaud commented 8 years ago

proposed fix on line 146:

if( self.playerInfo.device_info !== null ) signature.device_info = new Signature.DeviceInfo({ device_id: self.playerInfo.device_info.device_id, android_board_name: self.playerInfo.device_info.android_board_name, android_bootloader: self.playerInfo.device_info.android_bootloader, device_brand: self.playerInfo.device_info.device_brand, device_model: self.playerInfo.device_info.device_model, device_model_identifier: self.playerInfo.device_info.device_model_identifier, device_model_boot: self.playerInfo.device_info.device_model_boot, hardware_manufacturer: self.playerInfo.device_info.hardware_manufacturer, hardware_model: self.playerInfo.device_info.hardware_model, firmware_brand: self.playerInfo.device_info.firmware_brand, firmware_tags: self.playerInfo.device_info.firmware_tags, firmware_type: self.playerInfo.device_info.firmware_type, firmware_fingerprint: self.playerInfo.device_info.firmware_fingerprint });

hunterjm commented 8 years ago

You should submit a PR to fix.

billyriantono commented 8 years ago

please make a fork than a PR

billyriantono commented 8 years ago

have commit https://github.com/Armax/Pokemon-GO-node-api/commit/6aaf3dfb7af3b4a90e84d39911c0ca18733a84b2