fix(game/farmingsimulator): handle possible missing mod attribute (#723)

Fixed Problem with vanilla servers. when no mods are activated on the server the mod part is missing in the xml. (https://github.com/gamedig/node-gamedig/issues/722)
This commit is contained in:
yellowfromseegg 2025-07-29 09:23:05 +02:00 committed by GitHub
parent f251e89e3f
commit d7e9bba3cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,7 @@ export default class farmingsimulator extends Core {
mods: []
}
const mods = serverInfo.Mods.Mod
const mods = serverInfo?.Mods?.Mod || [];
for (const mod of mods) {
if (mod['@_name'] == null) { continue }