Skip to content

Commit

Permalink
fix: check null pointer
Browse files Browse the repository at this point in the history
`windowHandle` maybe a null pointer

Log:
  • Loading branch information
Johnson-zs authored and deepin-bot[bot] committed Feb 8, 2025
1 parent 7de74da commit 5a9ed13
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ FilePreviewDialog::FilePreviewDialog(const QList<QUrl> &previewUrllist, QWidget
}
firstEnterSwitchToPage = true;
switchToPage(0);
windowHandle()->installEventFilter(this);
if (windowHandle())
windowHandle()->installEventFilter(this);
}

FilePreviewDialog::~FilePreviewDialog()
Expand Down Expand Up @@ -151,7 +152,7 @@ void FilePreviewDialog::resizeEvent(QResizeEvent *event)
{
DAbstractDialog::resizeEvent(event);
QTimer::singleShot(50, this, [=]() { //! 50ms这个时间视机器性能而定
repaint(); //通过重绘来解决调整大小前的窗口残留的问题
repaint(); // 通过重绘来解决调整大小前的窗口残留的问题
});
}

Expand Down

0 comments on commit 5a9ed13

Please sign in to comment.