fix possible problem when trying to convert a binary format to a string

This commit is contained in:
kimchy 2010-09-28 12:32:40 +02:00
parent 86e17eae2c
commit 55ae6b2001
1 changed files with 7 additions and 1 deletions

View File

@ -389,7 +389,13 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
} }
parser.close(); parser.close();
} catch (Exception e) { } catch (Exception e) {
throw new SearchParseException(context, "Failed to parse [" + Unicode.fromBytes(source, offset, length) + "]", e); String sSource = "_na_";
try {
sSource = Unicode.fromBytes(source, offset, length);
} catch (Exception e1) {
// ignore
}
throw new SearchParseException(context, "Failed to parse [" + sSource + "]", e);
} }
} }