No need to reevaluate 'resource != null'