From aad6ce75b752a7300266322019aa2cb72a2b9c3e Mon Sep 17 00:00:00 2001 From: 0neGal Date: Thu, 9 Mar 2023 16:27:51 +0100 Subject: dont loop through modsobj if it's not set --- src/app/js/browser.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/app/js/browser.js b/src/app/js/browser.js index c6c74c9..206b80e 100644 --- a/src/app/js/browser.js +++ b/src/app/js/browser.js @@ -129,14 +129,16 @@ var Browser = { let remote_version = packages[i].versions[0].version_number; remote_version = version.format(remote_version); - for (let ii = 0; ii < modsobj.all.length; ii++) { - let mod = modsobj.all[ii]; - - if (normalize(mod.Name) === normalized) { - local_name = mod.Name; - local_version = version.format(mod.Version); - if (version.is_newer(remote_version, local_version)) { - has_update = true; + if (modsobj) { + for (let ii = 0; ii < modsobj.all.length; ii++) { + let mod = modsobj.all[ii]; + + if (normalize(mod.Name) === normalized) { + local_name = mod.Name; + local_version = version.format(mod.Version); + if (version.is_newer(remote_version, local_version)) { + has_update = true; + } } } } -- cgit v1.2.3