aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-06-14 23:50:43 +0200
committer0neGal <mail@0negal.com>2024-06-14 23:50:43 +0200
commit384977de2f89cdd26e15adc1f274bf46b3c7a03e (patch)
tree25803f6d20dd8c4c213955ea05c56f6a5d9ad5b6
parent04b0e9fcea6c60257d7bc68994103eacb340a82b (diff)
downloadViper-384977de2f89cdd26e15adc1f274bf46b3c7a03e.tar.gz
Viper-384977de2f89cdd26e15adc1f274bf46b3c7a03e.zip
verify VDF files gets parsed correctly
-rw-r--r--src/modules/findgame.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/findgame.js b/src/modules/findgame.js
index 505595f..f8d0126 100644
--- a/src/modules/findgame.js
+++ b/src/modules/findgame.js
@@ -30,6 +30,11 @@ module.exports = async () => {
function readvdf(data) {
data = vdf.parse(data); // parse read_data
+ // verify VDF was parsed correctly
+ if (! data || typeof data !== "object") {
+ return;
+ }
+
// list of folders where the game could possibly be installed at
let values = Object.values(data["libraryfolders"]);