Regeneration of non-creature permanents

Regenerating non-creature permanents causes exception error.
Thats because CTargetRegenerationSpell::ResolveCard casts CCard to the CCreatureCard pointer.
Code:
CCreatureCard* pCreatureCard = (CCreatureCard*)pCard;
pCreatureCard->AddRegenerationShield();
Affected cards: Welding Jar, Reknit.
The solution can be moving the regeneration code from CCreatureCard to CCard.
Thats because CTargetRegenerationSpell::ResolveCard casts CCard to the CCreatureCard pointer.
Code:
CCreatureCard* pCreatureCard = (CCreatureCard*)pCard;
pCreatureCard->AddRegenerationShield();
Affected cards: Welding Jar, Reknit.
The solution can be moving the regeneration code from CCreatureCard to CCard.