RF: check separately for Nones to avoid warning

Avoid future warning by checking for two Nones with separate if clauses.