Skip to content

Commit ba62d8e

Browse files
authored
Merge pull request #1471 from DFHack/ab9rf-mod-manager-patch-1
mod-manager.lua: do not except on missing mod metadata
2 parents 6f348f7 + 71194ed commit ba62d8e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Template for new versions:
3232
## New Features
3333

3434
## Fixes
35+
- `gui/mod-manager`: gracefully handle mods with missing or broken ``info.txt`` files
3536

3637
## Misc Improvements
3738

gui/mod-manager.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ function ModlistWindow:refresh_list()
524524
local choices = {}
525525
for idx,mod in ipairs(scriptmanager.get_active_mods()) do
526526
if not include_vanilla and mod.vanilla then goto continue end
527-
local steam_id = scriptmanager.get_mod_info_metadata(mod.path, 'STEAM_FILE_ID').STEAM_FILE_ID
527+
local metadata = scriptmanager.get_mod_info_metadata(mod.path, 'STEAM_FILE_ID')
528+
local steam_id = metadata and metadata.STEAM_FILE_ID or nil
528529
local url = steam_id and (': https://steamcommunity.com/sharedfiles/filedetails/?id=%s'):format(steam_id) or ''
529530
table.insert(choices, {
530531
text={

0 commit comments

Comments
 (0)