in reply to return a hash or undef

Other possibility:

if (keys %resp) {