Parcourir la source

fix(blur) check model response status and catch errors

master
Tudor D. Pop il y a 4 ans
Parent
révision
f69a31d9c6
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4
    0
      react/features/stream-effects/blur/index.js

+ 4
- 0
react/features/stream-effects/blur/index.js Voir le fichier

@@ -34,6 +34,10 @@ export async function createBlurEffect() {
34 34
         models['144']
35 35
     );
36 36
 
37
+    if (!modelResponse.ok) {
38
+        throw new Error('Failed to download tflite model!');
39
+    }
40
+
37 41
     const model = await modelResponse.arrayBuffer();
38 42
 
39 43
     tflite.HEAPU8.set(new Uint8Array(model), modelBufferOffset);

Chargement…
Annuler
Enregistrer