Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try creating an image if the surface is nil #105

Merged
merged 1 commit into from Apr 3, 2019
Merged

Don't try creating an image if the surface is nil #105

merged 1 commit into from Apr 3, 2019

Conversation

pointum
Copy link
Contributor

@pointum pointum commented Apr 3, 2019

When I deactivate the Client on an iPad (i.e. Home button), the Server crashes on my Mac.

The reason is that SLSDFRDisplayStreamCreate handler block provides nil frameSurface and no error.

TouchBarServer[5528:157215] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Invalid parameter not satisfying: ciImage != nil'
*** First throw call stack:
(
0   CoreFoundation          __exceptionPreprocess + 256
1   libobjc.A.dylib         objc_exception_throw + 48
2   CoreFoundation          +[NSException raise:format:arguments:] + 98
3   Foundation              -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
4   AppKit                  -[NSBitmapImageRep initWithCIImage:] + 577
5   TouchBarServer          __29-[AppDelegate startStreaming]_block_invoke + 176
6   DFRFoundation           DFRDisplayStream_FrameAvailable + 683
7   DFRFoundation           DFRDisplayStream_server + 286
8   libdispatch.dylib       dispatch_mig_server + 377
9   DFRFoundation           __42-[DFRDisplayStream initWithQueue:handler:]_block_invoke + 92
10  libdispatch.dylib       _dispatch_client_callout + 8
11  libdispatch.dylib       _dispatch_continuation_pop + 563
12  libdispatch.dylib       _dispatch_source_invoke + 2124
13  libdispatch.dylib       _dispatch_workloop_worker_thread + 691
14  libsystem_pthread.dylib _pthread_wqthread + 421
15  libsystem_pthread.dylib start_wqthread + 13
)
...

I’ve added a nil check to fix that.

@AndreasVerhoeven AndreasVerhoeven merged commit 03323b7 into bikkelbroeders:master Apr 3, 2019
@AndreasVerhoeven
Copy link
Contributor

Thank you for the work on this :)

@pointum pointum deleted the pointum-framesurface-nil branch May 8, 2020 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants