Merge "Add a check for null thread before trying to suspend"