pdemonaco / factorio-mod-updater

Python script to update mods on a dedicated factorio server
43 stars 14 forks source link

Missing check for empty array "matching_releases" #2

Closed Wyrrrd closed 4 years ago

Wyrrrd commented 4 years ago

Description: When having a mod in your mod_list, that does not have a release for the currently used Factorio version, mod_updater crashes.

Test: You can test this for example with the mod 1000sounds on a current Factorio version 0.18.x

Error message:

Traceback (most recent call last):
  File "/opt/factorioupdate/mod_updater.py", line 445, in <module>
    creds={'username': ARGS.username, 'token': ARGS.token})
  File "/opt/factorioupdate/mod_updater.py", line 109, in __init__
    self._retrieve_mod_metadata()
  File "/opt/factorioupdate/mod_updater.py", line 192, in _retrieve_mod_metadata
    data['latest'] = matching_releases[-1]
IndexError: list index out of range