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.

buddy_list: Assert we always find something with find_li.

evykassirer5d604a44299b
diff --git a/web/src/buddy_list.ts b/web/src/buddy_list.ts
index 76715a46133..206c33f7b28 100644
--- a/web/src/buddy_list.ts
+++ b/web/src/buddy_list.ts
@@ -580,10 +580,9 @@ export class BuddyList extends BuddyListConf {
if (pos < this.render_count) {
this.render_count -= 1;
const $li = this.find_li({key: opts.user_id});
- if ($li !== undefined) {
- $li.remove();
- this.update_padding();
- }
+ assert($li !== undefined);
+ $li.remove();
+ this.update_padding();
}
}
@@ -692,10 +691,9 @@ export class BuddyList extends BuddyListConf {
if (new_pos_in_all_users < this.render_count) {
this.render_count += 1;
const $li = this.find_li({key: user_id_following_insertion});
- if ($li !== undefined) {
- $li.before(html);
- this.update_padding();
- }
+ assert($li !== undefined);
+ $li.before(html);
+ this.update_padding();
}
}