Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade: Fix implicit use of any.

Anders Kaseorg7fb19cff980f
diff --git a/web/src/billing/upgrade.ts b/web/src/billing/upgrade.ts
index 3406b1d6db1..cfe43b0c154 100644
--- a/web/src/billing/upgrade.ts
+++ b/web/src/billing/upgrade.ts
@@ -177,7 +177,11 @@ export const initialize = (): void => {
$("#org-upgrade-button-text").show();
$("#org-upgrade-button .upgrade-button-loader").hide();
// Add a generic help text for card errors.
- if (xhr.responseJSON.error_description === "card error") {
+ if (
+ z
+ .object({error_description: z.literal("card error")})
+ .safeParse(xhr.responseJSON).success
+ ) {
const error_text = $error_box.text();
$error_box.text(`${error_text} Please fix this issue or use a different card.`);
}