From d43ec39352692ba49039ec91d076b543683e2352 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 10 Jan 2019 14:08:13 +0100 Subject: [PATCH] graphics - fixed 1 empty GPU, display --- lib/graphics.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/graphics.js b/lib/graphics.js index c72056c..5122497 100644 --- a/lib/graphics.js +++ b/lib/graphics.js @@ -187,7 +187,7 @@ function graphics(callback) { if (_3dcontrollerpos !== -1 && vgapos === -1) { vgapos = _3dcontrollerpos; } - if (Object.keys(currentController).length > 0) {// already a controller found + if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found controllers.push(currentController); currentController = { vendor: '', @@ -246,7 +246,7 @@ function graphics(callback) { } } } - if (Object.keys(currentController).length > 0) {// still controller information available + if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found controllers.push(currentController); } return (controllers); @@ -325,7 +325,7 @@ function graphics(callback) { for (let i = 1; i < lines.length; i++) { // start with second line if ('' !== lines[i].trim()) { if (' ' !== lines[i][0] && '\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry - if (Object.keys(currentDisplay).length > 0) { // push last display to array + if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // push last display to array displays.push(currentDisplay); currentDisplay = { model: '', @@ -369,7 +369,7 @@ function graphics(callback) { } // pushen displays - if (Object.keys(currentDisplay).length > 0) { // still information there + if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // still information there displays.push(currentDisplay); } return displays;