Handle possible NoMethodError bug

Since there's no else, need the assignment outside the conditionals
to ensure it's at least nil