Permalink
Browse files

Fixed: Generate null/undefined assertion in fromObject if actually NO…

…T an enum, see #620
  • Loading branch information...
dcodeIO committed Jan 12, 2017
1 parent 079388c commit 5bca18f2d32e8687986e23edade7c2aeb6b6bac1

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN -2 Bytes (100%) dist/noparse/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +0 Bytes (100%) dist/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
BIN +0 Bytes (100%) dist/runtime/protobuf.min.js.gz
Binary file not shown.
@@ -116,10 +116,10 @@ converter.fromObject = function fromObject(mtype) {
// Non-repeated fields
} else {
if (field.resolvedType instanceof Enum) gen // no need to test for null/undefined if an enum (uses switch)
if (!(field.resolvedType instanceof Enum)) gen // no need to test for null/undefined if an enum (uses switch)
("if(d%s!==undefined&&d%s!==null){", prop, prop);
genConvertValue_fromObject(gen, field, i, prop);
if (field.resolvedType instanceof Enum) gen
if (!(field.resolvedType instanceof Enum)) gen
("}");
}
}

0 comments on commit 5bca18f

Please sign in to comment.