Skip to content

Commit

Permalink
Other: Allow null values on optional long fields, see #590
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 29, 2016
1 parent 31da56c commit 3bab132
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions dist/noparse/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/noparse/protobuf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/noparse/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/noparse/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/noparse/protobuf.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/protobuf.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/runtime/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/runtime/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/runtime/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function encoder(mtype) {

if (field.long) {
gen
("if(%s!==undefined&&util.longNe(%s,%d,%d))", ref, ref, field.defaultValue.low, field.defaultValue.high);
("if(%s!==undefined&&%s!==null&&util.longNe(%s,%d,%d))", ref, ref, ref, field.defaultValue.low, field.defaultValue.high);
} else gen
("if(%s!==undefined&&%s!==%j)", ref, ref, field.defaultValue);

Expand Down

0 comments on commit 3bab132

Please sign in to comment.