From 266b33dc428f853d279a179907a38d999d4dc86b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 25 Dec 2019 19:24:23 +0100 Subject: fix bug in the WebExtensions pay page --- src/util/codec.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/util') diff --git a/src/util/codec.ts b/src/util/codec.ts index e18a5e74c..09fa9f953 100644 --- a/src/util/codec.ts +++ b/src/util/codec.ts @@ -106,6 +106,12 @@ class ObjectCodecBuilder { path: [`(${objectDisplayName})`], }; } + if (typeof x !== "object") { + throw new DecodingError( + `expected object for ${objectDisplayName} at ${renderContext( + c, + )} but got ${typeof x}`) + } const obj: any = {}; for (const prop of propList) { const propRawVal = x[prop.name]; -- cgit v1.2.3