fix null variable in state

Summary:
Fix "Cannot read property 'monitoring' of null" in CPU plugin.

{F132280986}

Reviewed By: danielbuechele

Differential Revision: D8800114

fbshipit-source-id: c363eda71e4d580fdd12ff1dc3981feaaafeae93
This commit is contained in:
Barney Huang
2018-07-11 06:50:32 -07:00
committed by Facebook Github Bot
parent c50b2864ce
commit c048e03d03

View File

@@ -104,13 +104,13 @@ export default class CPUFrequencyTable extends SonarDevicePlugin<CPUState> {
intervalID: ?IntervalID; intervalID: ?IntervalID;
device: AndroidDevice; device: AndroidDevice;
init() { state = {
this.setState({
cpuFreq: [], cpuFreq: [],
cpuCount: 0, cpuCount: 0,
monitoring: false, monitoring: false,
}); };
init() {
this.adbClient = this.device.adb; this.adbClient = this.device.adb;
// check how many cores we have on this device // check how many cores we have on this device