Skip to content

Commit 0abac54

Browse files
committed
safeguard messageBox if its null
1 parent 10be21e commit 0abac54

File tree

1 file changed

+6
-2
lines changed
  • frontend/src/components/app/matches

1 file changed

+6
-2
lines changed

frontend/src/components/app/matches/Chat.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export default {
7272
this.message = '';
7373
this.$nextTick(() => {
7474
const messageBox = document.getElementById('messageBox');
75-
messageBox.scrollTop = messageBox.scrollHeight;
75+
if (messageBox) {
76+
messageBox.scrollTop = messageBox.scrollHeight;
77+
}
7678
});
7779
},
7880
},
@@ -84,7 +86,9 @@ export default {
8486
this.loggedInUserId = this.$store.getters.getLoggedInUser.id;
8587
this.$nextTick(() => {
8688
const messageBox = document.getElementById('messageBox');
87-
messageBox.scrollTop = messageBox.scrollHeight;
89+
if (messageBox) {
90+
messageBox.scrollTop = messageBox.scrollHeight;
91+
}
8892
});
8993
},
9094
};

0 commit comments

Comments
 (0)