What makes sense?

I removed h.has_metadata() from line 351, because h.has_metadata()  is already checked in outer if (line 340), so this condition is always true.