Skip to content

Commit 0c9ef70

Browse files
committed
fix: type matching should not early return when value is object
1 parent d727adb commit 0c9ef70

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/stores/typeRegistry.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,13 @@ function matchTypeComponents<Value> (
5959
for (const T of registry) {
6060
if (T.is(value, path)) {
6161
potential = T
62-
if (typeof value === 'object') {
63-
// early return for case like `null`
64-
return T
65-
}
6662
}
6763
}
6864
if (potential === undefined) {
6965
if (typeof value === 'object') {
7066
return objectType as unknown as DataType<Value>
7167
}
72-
throw new Error('this is not possible')
68+
throw new Error(`No type matched for value: ${value}`)
7369
}
7470
return potential
7571
}

0 commit comments

Comments
 (0)