There should be better error handling here in general, but an empty string is something that Nmap can legitimately emit. http://seclists.org/nmap-dev/2012/q2/876