This commit is contained in:
Mark Probst 2018-06-11 06:48:40 -07:00
Родитель 2396d54e0c
Коммит aa7c3f1449
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -847,7 +847,9 @@ export class NewtonsoftCSharpRenderer extends CSharpRenderer {
private emitDecodeTransformer(xfer: Transformer, targetType: Type, variableName: string = "value"): boolean {
if (xfer instanceof DecodingTransformer) {
this.emitLine("var ", variableName, " = ", this.deserializeTypeCode(this.csType(xfer.sourceType)), ";");
if (xfer.sourceType.kind !== "null") {
this.emitLine("var ", variableName, " = ", this.deserializeTypeCode(this.csType(xfer.sourceType)), ";");
}
return this.emitConsume(variableName, xfer.consumer, targetType);
} else if (xfer instanceof DecodingChoiceTransformer) {
this.emitDecoderSwitch(() => {