add check data valid in getStringFromFile

so far no check would be crashed when getData failed.
maybe return an empty string is better.