I don't know, but the code a few lines above did the same check before accessing g_cost.type.dtype, so I assume it could happen.