Prevent possible error when findChannel can't find the wanted channel

Using ?. (optional chaining) requires ecma version 2020 as it is fairly new. Webpack / Babel can handle it.
This commit is contained in:
Nachtalb 2021-05-05 18:09:18 +02:00
parent 11aa52687c
commit 04cf2277d9
No known key found for this signature in database
GPG Key ID: E48DF13C07055D92
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
root: true
parserOptions:
ecmaVersion: 2018
ecmaVersion: 2020
env:
es6: true

View File

@ -6,7 +6,7 @@ import socket from "../socket";
import store from "../store";
socket.on("more", function (data) {
const channel = store.getters.findChannel(data.chan).channel;
const channel = store.getters.findChannel(data.chan)?.channel;
if (!channel) {
return;