If CurrentThread isn't running a goroutine SelectedGoroutine can be nil, do not blindly dereference it. Fixes #827