Skip to content

Commit

Permalink
Fix TypeError and missing license detected when null was provided
Browse files Browse the repository at this point in the history
  • Loading branch information
3urobeat committed Dec 25, 2023
1 parent 240ad2a commit bbd97d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/bot/helpers/handleMissingGameLicenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 29.06.2023 21:31:53
* Author: 3urobeat
*
* Last Modified: 14.10.2023 10:35:38
* Last Modified: 25.12.2023 22:12:16
* Modified By: 3urobeat
*
* Copyright (c) 2023 3urobeat <https://github.com/3urobeat>
Expand All @@ -27,7 +27,7 @@ Bot.prototype.handleMissingGameLicenses = function() {
// Check if user provided games specifically for this account. We only need to check this for child accounts
let configChildGames = data.config.childaccplayinggames;

if (typeof configChildGames[0] == "object") {
if (typeof configChildGames[0] == "object" && configChildGames[0] != null) { // - typeof null == "object"
if (Object.keys(configChildGames[0]).includes(this.loginData.logOnOptions.accountName)) configChildGames = configChildGames[0][this.loginData.logOnOptions.accountName]; // Get the specific settings for this account if included
else configChildGames = configChildGames.slice(1); // ...otherwise remove object containing acc specific settings to use the generic ones

Expand All @@ -40,7 +40,7 @@ Bot.prototype.handleMissingGameLicenses = function() {

let options = {
includePlayedFreeGames: true,
filterAppids: this.index == 0 ? data.config.playinggames.filter(e => !isNaN(e)) : configChildGames.filter(e => !isNaN(e)), // We only need to check for these appIDs. Filter custom game string
filterAppids: this.index == 0 ? data.config.playinggames.filter(e => !isNaN(e)) : configChildGames.filter(e => !isNaN(e) && e != null), // We only need to check for these appIDs. Filter custom game string and null values
includeFreeSub: false
};

Expand Down Expand Up @@ -94,4 +94,4 @@ Bot.prototype.handleMissingGameLicenses = function() {
startPlaying();
}

};
};
2 changes: 1 addition & 1 deletion src/data/fileStructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
{
"path": "src/bot/helpers/handleMissingGameLicenses.js",
"url": "https://raw.githubusercontent.com/3urobeat/steam-comment-service-bot/beta-testing/src/bot/helpers/handleMissingGameLicenses.js",
"checksum": "841bf2256855624b39a5370a67c09bc0"
"checksum": "a2f8b1267bc2cda3bc2b5a0281fd9b52"
},
{
"path": "src/bot/helpers/handleRelog.js",
Expand Down

0 comments on commit bbd97d5

Please sign in to comment.