From 90f07438caa493f42eb8b533debf8f67d7d0b2b7 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Wed, 28 Jun 2023 10:51:30 -0700 Subject: [PATCH] idx: Fix Flow type error --- packages/idx/src/idx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/idx/src/idx.js b/packages/idx/src/idx.js index 2bf5c3f..89eda01 100644 --- a/packages/idx/src/idx.js +++ b/packages/idx/src/idx.js @@ -60,9 +60,9 @@ function idx(input: Ti, accessor: (input: Ti) => Tv): ?Tv { return accessor(input); } catch (error) { if (error instanceof TypeError) { - if (nullPattern.test(error)) { + if (nullPattern.test(error.message)) { return null; - } else if (undefinedPattern.test(error)) { + } else if (undefinedPattern.test(error.message)) { return undefined; } }