Commit 05266dc
committed
allow custom encoders to handle nil pointers
If a custom encoder is defined on a pointer of a type, allow that
encoder to handle nil values. Encoders defined on non-pointer types
will continue to be given the zero value of the type to encode (the
existing behavior).
Fixes #461 parent 597fdbe commit 05266dc
2 files changed
+18
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 181 | | |
189 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
190 | 185 | | |
191 | 186 | | |
192 | 187 | | |
| |||
197 | 192 | | |
198 | 193 | | |
199 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
557 | 559 | | |
558 | | - | |
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
| |||
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
597 | | - | |
| 598 | + | |
598 | 599 | | |
599 | 600 | | |
600 | 601 | | |
| |||
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
609 | | - | |
| 610 | + | |
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
615 | | - | |
| 616 | + | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
621 | | - | |
| 622 | + | |
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
| |||
0 commit comments