Fix possible crash with nullptr screen.

This commit is contained in:
John Preston 2019-04-12 17:23:16 +04:00
parent 7cfb122dea
commit 12614ab68c

View File

@ -287,7 +287,9 @@ void MainMenu::initResetScaleButton() {
handle->screen()
) | rpl::then(
Core::QtSignalProducer(handle, &QWindow::screenChanged)
) | rpl::map([](QScreen *screen) {
) | rpl::filter([](QScreen *screen) {
return screen != nullptr;
}) | rpl::map([](QScreen * screen) {
return rpl::single(
screen->availableGeometry()
) | rpl::then(