Check if dynamic_cast failed.