Merge pull request #16170 from zfox23/copyToClipboardProtection

BUGZ-1445: Protect against engine not returning a valid CPU/GPU object in Help -> About
This commit is contained in:
Zach Fox 2019-09-10 14:04:44 -07:00 committed by GitHub
commit f6f3c67b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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";
}