If get_stopped_thread(... eStopReasonSignal) returns no thread, the thread.IsValid assertion would throw AttributeError: 'NoneType' object has no attribute 'IsValid'.
lgtm