mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 07:32:10 +02:00
Protect against engine not returning a valid CPU/GPU object
This commit is contained in:
parent
4246d89eac
commit
50ba55a988
1 changed files with 4 additions and 4 deletions
|
@ -167,7 +167,7 @@ Flickable {
|
|||
Component.onCompleted: {
|
||||
var cpu = JSON.parse(PlatformInfo.getCPU(0));
|
||||
var cpuModel = cpu.model;
|
||||
if (cpuModel.length === 0) {
|
||||
if (!cpuModel || cpuModel.length === 0) {
|
||||
cpuModel = "Unknown";
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ Flickable {
|
|||
Component.onCompleted: {
|
||||
var gpu = JSON.parse(PlatformInfo.getGPU(PlatformInfo.getMasterGPU()));
|
||||
var gpuModel = gpu.model;
|
||||
if (gpuModel.length === 0) {
|
||||
if (!gpuModel || gpuModel.length === 0) {
|
||||
gpuModel = "Unknown";
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ Flickable {
|
|||
|
||||
var cpu = JSON.parse(PlatformInfo.getCPU(0));
|
||||
var cpuModel = cpu.model;
|
||||
if (cpuModel.length === 0) {
|
||||
if (!cpuModel || cpuModel.length === 0) {
|
||||
cpuModel = "Unknown";
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,7 @@ Flickable {
|
|||
|
||||
var gpu = JSON.parse(PlatformInfo.getGPU(PlatformInfo.getMasterGPU()));
|
||||
var gpuModel = gpu.model;
|
||||
if (gpuModel.length === 0) {
|
||||
if (!gpuModel || gpuModel.length === 0) {
|
||||
gpuModel = "Unknown";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue