applying android crash fix for testing purposes

This commit is contained in:
Anna 2019-07-23 16:03:20 -07:00
parent 1df43fc83a
commit ca24693f39

View file

@ -104,34 +104,34 @@ void Instance::enumerateNics() {
}
}
}
json Instance::getCPU(int index) {
assert(index <(int) _cpus.size());
if (index >= (int)_cpus.size())
assert(index < (int)_cpus.size());
if (index < 0 || (int)_cpus.size() <= index)
return json();
return _cpus.at(index);
}
json Instance::getGPU(int index) {
assert(index <(int) _gpus.size());
assert(index < (int)_gpus.size());
if (index >=(int) _gpus.size())
if (index < 0 || (int)_gpus.size() <= index)
return json();
return _gpus.at(index);
}
json Instance::getDisplay(int index) {
assert(index <(int) _displays.size());
if (index >=(int) _displays.size())
assert(index < (int)_displays.size());
if (index < 0 || (int)_displays.size() <= index)
return json();
return _displays.at(index);
}
Instance::~Instance() {
if (_cpus.size() > 0) {
_cpus.clear();