mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: check if latestversion is valid before using semver.gt
This commit is contained in:
@@ -28,12 +28,13 @@ dashboardController.get = async function (req, res) {
|
||||
getPopularSearches(),
|
||||
]);
|
||||
const version = nconf.get('version');
|
||||
const latestValidVersion = semver.valid(latestVersion);
|
||||
|
||||
res.render('admin/dashboard', {
|
||||
version: version,
|
||||
lookupFailed: latestVersion === null,
|
||||
latestVersion: latestVersion,
|
||||
upgradeAvailable: latestVersion && semver.gt(latestVersion, version),
|
||||
lookupFailed: latestValidVersion === null,
|
||||
latestVersion: latestValidVersion,
|
||||
upgradeAvailable: latestValidVersion && semver.gt(latestValidVersion, version),
|
||||
currentPrerelease: versions.isPrerelease.test(version),
|
||||
notices: notices,
|
||||
stats: stats,
|
||||
|
||||
Reference in New Issue
Block a user