Wrap empty string test in try catch