From 559741fd070e8ad67b22b43f0a92f4ac50b4ebbe Mon Sep 17 00:00:00 2001 From: n1474335 Date: Thu, 15 Feb 2018 18:46:17 +0000 Subject: [PATCH] Fixed a few small bugs --- src/core/lib/Magic.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/lib/Magic.js b/src/core/lib/Magic.js index 53972d66..47dadb9e 100644 --- a/src/core/lib/Magic.js +++ b/src/core/lib/Magic.js @@ -214,7 +214,7 @@ class Magic { const testEnc = async op => { for (let i = 0; i < encodings.length; i++) { const conf = { - op: "Encode text", + op: op, args: [encodings[i]] }, data = await this._runRecipe([conf], sample.buffer); @@ -343,9 +343,11 @@ class Magic { const recipe = new Recipe(recipeConfig); try { await recipe.execute(dish, 0); - } catch (err) {} // Ignore errors - - return dish.get(Dish.ARRAY_BUFFER); + return dish.get(Dish.ARRAY_BUFFER); + } catch (err) { + // If there are errors, return an empty buffer + return new ArrayBuffer(); + } } /**