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.

rows: Throw exception instead of returning NaN.

evykassirere3e0125092c0
diff --git a/web/src/rows.js b/web/src/rows.js
index acb1d70dfa1..afad1ae921a 100644
--- a/web/src/rows.js
+++ b/web/src/rows.js
@@ -80,22 +80,14 @@ export function id($message_row) {
return undefined;
}
- /*
- For blueslip errors, don't return early, since
- we may have some code now that actually relies
- on the NaN behavior here. We can try to clean
- that up in the future, but we mainly just want
- more data now.
- */
-
if ($message_row.length !== 1) {
- blueslip.error("Caller should pass in a single row.");
+ throw new Error("Caller should pass in a single row.");
}
const zid = $message_row.attr("zid");
if (zid === undefined) {
- blueslip.error("Calling code passed rows.id a row with no zid attr.");
+ throw new Error("Calling code passed rows.id a row with no zid attr.");
}
return Number.parseFloat(zid);