Fix crash when creating a new card.