NullPointerexception at org.elasticsearch.action.get.GetResponse.sourceAsString, closes #68

This commit is contained in:
kimchy 2010-03-18 14:08:45 +02:00
parent cd2090bc79
commit fc3a805514
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,9 @@ public class GetResponse implements ActionResponse, Streamable, Iterable<GetFiel
* The source of the document (as a string).
*/
public String sourceAsString() {
if (source == null) {
return null;
}
return Unicode.fromBytes(source);
}