Skip to content
Permalink
Browse files
Fix NPE
  • Loading branch information
dkulp committed Aug 4, 2017
1 parent b836aa8 commit 1336710aa119c8df43bcd600ce96b8d6018010d6
Showing 1 changed file with 3 additions and 3 deletions.
@@ -450,9 +450,9 @@ private void updateSetter(ClassOutline co, FieldOutline fo,
JFieldRef fr = JExpr.ref(fieldName);
method.body().assign(fr, var);

method = dc.getMethod("unset" + fo.getPropertyInfo().getName(true), new JType[0]);
if (method != null) {
dc.methods().remove(method);
JMethod oldMethod = dc.getMethod("unset" + fo.getPropertyInfo().getName(true), new JType[0]);
if (oldMethod != null) {
dc.methods().remove(oldMethod);
}
method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
method.body().assign(fr, JExpr._null());

0 comments on commit 1336710

Please sign in to comment.