- 
    
Bug
 - 
    Resolution: Done
 - 
    
P1: Critical
 - 
    5.13.1
 
Description
When you unplug the external screen attached to a closed MacBookPro, all running Qt applications are crashing.
Reproducibility
- This issue is reproducible with Qt 5.13.1 on macOS 10.15.1
 
Steps to reproduce
- Attach an external display to a MacBook Pro. I used a Thunderbolt Dock and Display Port to connect the external display.
 - Close the MacBook Pro
 - Launch any Qt application on the external screen. For example Qt Creator or Linguist.app.
 - Unplug the Thunderbold cable of the external display
 - Open the lid after having unplugged the cable and with the cable still unplugged
 
Result: All running Qt applications (for example Qt Creator or Linguist.app) have crashed
More info
The crash occurs in windowWillUseStandardFrame:defaultFrame: in qnswindowdelegate.mm.
As you can see in this code, there is no check for NULL pointer for platformWindow->screen() which is I think causing the crash:
    const QRectF screenGeometry = platformWindow->screen()->geometry();
Qt Support:
Tested the steps to reproduce with similar equipment. Could not reproduce the issue. We suspect that some setting or other unknown is causing this.