mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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(),
|
getPopularSearches(),
|
||||||
]);
|
]);
|
||||||
const version = nconf.get('version');
|
const version = nconf.get('version');
|
||||||
|
const latestValidVersion = semver.valid(latestVersion);
|
||||||
|
|
||||||
res.render('admin/dashboard', {
|
res.render('admin/dashboard', {
|
||||||
version: version,
|
version: version,
|
||||||
lookupFailed: latestVersion === null,
|
lookupFailed: latestValidVersion === null,
|
||||||
latestVersion: latestVersion,
|
latestVersion: latestValidVersion,
|
||||||
upgradeAvailable: latestVersion && semver.gt(latestVersion, version),
|
upgradeAvailable: latestValidVersion && semver.gt(latestValidVersion, version),
|
||||||
currentPrerelease: versions.isPrerelease.test(version),
|
currentPrerelease: versions.isPrerelease.test(version),
|
||||||
notices: notices,
|
notices: notices,
|
||||||
stats: stats,
|
stats: stats,
|
||||||
|
|||||||
Reference in New Issue
Block a user