Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

theme(server): fix `undefined is not an object` crash

Abdullah Atta7b216d4c9a48
diff --git a/servers/themes/src/orama.ts b/servers/themes/src/orama.ts
index 8f970c97f..96899e2a9 100644
--- a/servers/themes/src/orama.ts
+++ b/servers/themes/src/orama.ts
@@ -51,7 +51,7 @@ export async function findTheme(
compatibilityVersion: { eq: compatibilityVersion }
}
});
- return results.hits[0].document as CompiledThemeDefinition;
+ return results.hits[0]?.document as CompiledThemeDefinition | undefined;
}
export async function updateTotalInstalls(