From f69a31d9c6109c6604de4f445d2e6412b63ccb62 Mon Sep 17 00:00:00 2001 From: "Tudor D. Pop" Date: Fri, 19 Feb 2021 16:00:07 +0200 Subject: [PATCH] fix(blur) check model response status and catch errors --- react/features/stream-effects/blur/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/react/features/stream-effects/blur/index.js b/react/features/stream-effects/blur/index.js index caa475ded..57f49fd09 100644 --- a/react/features/stream-effects/blur/index.js +++ b/react/features/stream-effects/blur/index.js @@ -34,6 +34,10 @@ export async function createBlurEffect() { models['144'] ); + if (!modelResponse.ok) { + throw new Error('Failed to download tflite model!'); + } + const model = await modelResponse.arrayBuffer(); tflite.HEAPU8.set(new Uint8Array(model), modelBufferOffset);