Better checking for null value in Cell.load.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@224 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-07 00:35:44 +00:00
parent e0d72c81e9
commit e06d8fe130

View File

@ -84,9 +84,9 @@ public class Cell implements Serializable, HasFields, Jsonizable {
if (obj.has("e")) { if (obj.has("e")) {
value = new EvalError(obj.getString("e")); value = new EvalError(obj.getString("e"));
} else if (obj.has("v")) { } else if (obj.has("v") && !obj.isNull("v")) {
value = (Serializable) obj.get("v"); value = (Serializable) obj.get("v");
if (obj.has("t")) { if (obj.has("t") && !obj.isNull("t")) {
String type = obj.getString("t"); String type = obj.getString("t");
if ("date".equals(type)) { if ("date".equals(type)) {
value = ParsingUtilities.stringToDate((String) value); value = ParsingUtilities.stringToDate((String) value);
@ -94,7 +94,7 @@ public class Cell implements Serializable, HasFields, Jsonizable {
} }
} }
if (obj.has("r")) { if (obj.has("r") && !obj.isNull("r")) {
recon = Recon.load(obj.getJSONObject("r")); recon = Recon.load(obj.getJSONObject("r"));
} }