We saw in some very rare cases the library fails to load the main Display with an NPE.
GetMainOutput is documented to return null sometimes, but get_MainMonitor tries to always access the object without a null check. We have observed instances where this leads to an NPE in our logs (when trying to initialize the displays from managed code).
We saw in some very rare cases the library fails to load the main Display with an NPE.
GetMainOutput is documented to return null sometimes, but get_MainMonitor tries to always access the object without a null check. We have observed instances where this leads to an NPE in our logs (when trying to initialize the displays from managed code).
Maybe we should instead allow the caller to handle the case where no Main Display was selected by checking if the returned Display is null (allowing the manage code to gracefully show a user facing error and recover). https://github.com/sskodje/ScreenRecorderLib/blob/bcad5cf06fb4f7ed66dd8db5dc855a220fa7313b/ScreenRecorderLib/RecordingSources.h#L208