ScreenCaptureKit sample code crash at strange position

I tried the ScreenCaptureKit sample code from Apple: ScreenCaptureKit Sample Code

When I ran it for a while, it crash at the strange position as attached screenshot.

The value array is not empty and has value at index 0 but it crashed.

ScreenCaptureKit sample code crash at strange position
 
 
Q