mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 11:41:17 +02:00
Merge pull request #15968 from annabrewer/android-crash-fix
BUGZ-996: Android app crashes on startup
This commit is contained in:
commit
a8842bf521
1 changed files with 4 additions and 3 deletions
|
@ -107,7 +107,8 @@ void Instance::enumerateNics() {
|
||||||
|
|
||||||
json Instance::getCPU(int index) {
|
json Instance::getCPU(int index) {
|
||||||
assert(index <(int) _cpus.size());
|
assert(index <(int) _cpus.size());
|
||||||
if (index >= (int)_cpus.size())
|
|
||||||
|
if (index < 0 || (int) _cpus.size() <= index)
|
||||||
return json();
|
return json();
|
||||||
|
|
||||||
return _cpus.at(index);
|
return _cpus.at(index);
|
||||||
|
@ -116,7 +117,7 @@ json Instance::getCPU(int index) {
|
||||||
json Instance::getGPU(int 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 json();
|
||||||
|
|
||||||
return _gpus.at(index);
|
return _gpus.at(index);
|
||||||
|
@ -126,7 +127,7 @@ json Instance::getGPU(int index) {
|
||||||
json Instance::getDisplay(int index) {
|
json Instance::getDisplay(int index) {
|
||||||
assert(index <(int) _displays.size());
|
assert(index <(int) _displays.size());
|
||||||
|
|
||||||
if (index >=(int) _displays.size())
|
if (index < 0 || (int) _displays.size() <= index)
|
||||||
return json();
|
return json();
|
||||||
|
|
||||||
return _displays.at(index);
|
return _displays.at(index);
|
||||||
|
|
Loading…
Reference in a new issue