Utils: Fix getServerVersionFromPackageJson

The cache is never null, because it defaults to undefined, and therefore this function always returns undefined.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-04-15 18:15:25 +02:00
parent caa4b1c927
commit dff5a635e0
2 changed files with 28 additions and 1 deletions

View file

@ -11,7 +11,7 @@ import { join as joinPath } from 'path';
let versionCache: ServerVersion;
export async function getServerVersionFromPackageJson(): Promise<ServerVersion> {
if (versionCache === null) {
if (versionCache === undefined) {
const rawFileContent: string = await fs.readFile(
joinPath(__dirname, '../../package.json'),
{ encoding: 'utf8' },