Fix null handling
This commit is contained in:
@@ -48,7 +48,7 @@ const UserProfiles: FunctionComponent = () => {
|
||||
|
||||
const showUserMenu = (elem: HTMLElement) => {
|
||||
const card = dom.parentWithClass(elem, 'card');
|
||||
const userId = card.getAttribute('data-userid');
|
||||
const userId = card?.getAttribute('data-userid');
|
||||
|
||||
if (!userId) {
|
||||
console.error('Unexpected null user id');
|
||||
|
||||
Reference in New Issue
Block a user