summaryrefslogtreecommitdiff
path: root/packages/client/src/components
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2022-12-18 19:52:50 +0900
committerGitHub <noreply@github.com>2022-12-18 19:52:50 +0900
commit88859cf67d5389ace9fe6db3ae153961979b50fc (patch)
tree6017ed063749645d1852c8a29f26d6d9bd7dbc0e /packages/client/src/components
parentenhance: Push notification of Antenna note (#9338) (diff)
downloadmisskey-88859cf67d5389ace9fe6db3ae153961979b50fc.tar.gz
misskey-88859cf67d5389ace9fe6db3ae153961979b50fc.tar.bz2
misskey-88859cf67d5389ace9fe6db3ae153961979b50fc.zip
fix(client): Handle null of rootEl in MkWindow.vue (#9326)
* fix(client): Handle null of rootEl in MkWindow.vue * comment Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/client/src/components')
-rw-r--r--packages/client/src/components/MkWindow.vue7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/client/src/components/MkWindow.vue b/packages/client/src/components/MkWindow.vue
index 758d4d47b6..0ab4382632 100644
--- a/packages/client/src/components/MkWindow.vue
+++ b/packages/client/src/components/MkWindow.vue
@@ -221,6 +221,8 @@ function onHeaderMousedown(evt: MouseEvent) {
// 上ハンドル掴み時
function onTopHandleMousedown(evt) {
const main = rootEl;
+ // どういうわけかnullになることがある
+ if (main == null) return;
const base = evt.clientY;
const height = parseInt(getComputedStyle(main, '').height, 10);
@@ -247,6 +249,7 @@ function onTopHandleMousedown(evt) {
// 右ハンドル掴み時
function onRightHandleMousedown(evt) {
const main = rootEl;
+ if (main == null) return;
const base = evt.clientX;
const width = parseInt(getComputedStyle(main, '').width, 10);
@@ -271,6 +274,7 @@ function onRightHandleMousedown(evt) {
// 下ハンドル掴み時
function onBottomHandleMousedown(evt) {
const main = rootEl;
+ if (main == null) return;
const base = evt.clientY;
const height = parseInt(getComputedStyle(main, '').height, 10);
@@ -295,6 +299,7 @@ function onBottomHandleMousedown(evt) {
// 左ハンドル掴み時
function onLeftHandleMousedown(evt) {
const main = rootEl;
+ if (main == null) return;
const base = evt.clientX;
const width = parseInt(getComputedStyle(main, '').width, 10);
@@ -366,6 +371,8 @@ function applyTransformLeft(left) {
function onBrowserResize() {
const main = rootEl;
+ if (main == null) return;
+
const position = main.getBoundingClientRect();
const browserWidth = window.innerWidth;
const browserHeight = window.innerHeight;