satisfactorymodding / SatisfactoryModManager

A mod manager for easy installation of mods and modloader for Satisfactory
GNU General Public License v3.0
360 stars 77 forks source link

Lutris installfinder doesnt handle "null" directories #67

Closed chestm007 closed 3 years ago

chestm007 commented 3 years ago

Starting the mod manager with games in your lutris library with null directories throws an error and prevents the ModManager from running.

lutris -lj snippet:

  {
    "id": 5,
    "slug": "multimc",
    "name": "MultiMC",
    "runner": "linux",
    "directory": ""
  },
  {
    "id": 24,
    "slug": "super-smash-bros",
    "name": "super smash bros",
    "runner": "libretro",
    "directory": null
  },

results in the following logged error

2020-10-15 11:45:14:494 [DEBUG] Epic Games Launcher is not installed in Lutris - MultiMC
2020-10-15 11:45:14:498 [ERROR] The "path" argument must be of type string. Received type object
Trace
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at validateString (internal/validators.js:112:11)
    at Object.join (path.js:1039:7)
    at /tmp/.mount_SatisfNzJvYt/resources/app.asar/node_modules/satisfactory-mod-manager-api/lib/installfinders/linux/lutrisEpic.js:21:48
    at Array.forEach (<anonymous>)
    at Object.getInstalls (/tmp/.mount_SatisfNzJvYt/resources/app.asar/node_modules/satisfactory-mod-manager-api/lib/installfinders/linux/lutrisEpic.js:20:21)
    at Object.getInstalls (/tmp/.mount_SatisfNzJvYt/resources/app.asar/node_modules/satisfactory-mod-manager-api/lib/installfinders/linux/index.js:10:37)
    at getInstalls (/tmp/.mount_SatisfNzJvYt/resources/app.asar/node_modules/satisfactory-mod-manager-api/lib/installfinders/index.js:11:24)
    at file:///tmp/.mount_SatisfNzJvYt/resources/app.asar/dist/electron/renderer.js:1:1772484
    at i (file:///tmp/.mount_SatisfNzJvYt/resources/app.asar/dist/electron/renderer.js:1:781789)
    at Generator._invoke (file:///tmp/.mount_SatisfNzJvYt/resources/app.asar/dist/electron/renderer.js:1:782881)

seems a simple null filter or exception catching block would work here

mircearoata commented 3 years ago

Fixed in v2.3.0