Added null guard to contract setStatus.