Skip to content

Commit cba74b9

Browse files
committed
Idk what changed
1 parent c286cd6 commit cba74b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/javawebstack/graph/GraphMapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,17 @@ public boolean shouldSkipField(FieldAttributes fieldAttributes) {
5757
public boolean shouldSkipClass(Class<?> aClass) { return false; }
5858
});
5959
}
60-
return builder.create();
60+
gson = builder.create();
61+
return gson;
6162
}
6263

6364
public GraphElement toGraph(Object object){
6465
return GraphElement.fromJson(gson().toJsonTree(object));
6566
}
6667

6768
public <T> T fromGraph(GraphElement element, Class<T> type){
69+
if(element == null)
70+
return null;
6871
return gson().fromJson(element.toJson(), type);
6972
}
7073

0 commit comments

Comments
 (0)