Fix npe when stat queries return empty result.