From 97d78589b6a049b3041aea097398ba639f4b6240 Mon Sep 17 00:00:00 2001 From: David Robert-Ansart Date: Tue, 13 Feb 2024 14:50:56 +0100 Subject: [PATCH] Fix h5p unique id loading --- .vscode/settings.json | 2 +- server/h5p/get-h5p-editor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8d97301fe..fc0584be1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,6 +9,6 @@ "typescript.enablePromptUseWorkspaceTsdk": true, "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" } } diff --git a/server/h5p/get-h5p-editor.ts b/server/h5p/get-h5p-editor.ts index 741e9bee4..18b32a471 100644 --- a/server/h5p/get-h5p-editor.ts +++ b/server/h5p/get-h5p-editor.ts @@ -35,7 +35,7 @@ export const getH5pEditor = async () => { const keyValueStorage = new AwsKeyValueStorage(); await keyValueStorage.init(); - const savedConfigId = await keyValueStorage.load('uuid'); + const savedConfigId = (await keyValueStorage.load('uuid').catch(() => undefined)) as string | undefined; const config = await new H5P.H5PConfig(keyValueStorage, savedConfigId ? undefined : DEFAULT_CONFIG).load(); if (savedConfigId === undefined) { logger.info('Save H5p config');