Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

add user not null check

Abhinavc5c39a6091b8
diff --git a/apps/photos/src/components/MachineLearning/ImageViews.tsx b/apps/photos/src/components/MachineLearning/ImageViews.tsx
index 6d26218f86..4f9f4344b1 100644
--- a/apps/photos/src/components/MachineLearning/ImageViews.tsx
+++ b/apps/photos/src/components/MachineLearning/ImageViews.tsx
@@ -32,11 +32,11 @@ export function ImageCacheView(props: {
useEffect(() => {
let didCancel = false;
- const user: User = getData(LS_KEYS.USER);
async function loadImage() {
try {
+ const user: User = getData(LS_KEYS.USER);
let blob: Blob;
- if (!props.url || !props.cacheName) {
+ if (!props.url || !props.cacheName || !user) {
blob = undefined;
} else {
blob = await cached(