Prevent error on passing null to crop method