-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: indirection through nil pointer to embedded struct (#211)
The provided test `TestUnmarshallToEmbeddedNoData` shows that the decoder panics when `setDefaults` encounters a nil pointer to an embedded struct. The fix replaces `FieldByName` with `FieldByIndexErr` to catch this kind of situation and continue with the next field.
- Loading branch information
Showing
2 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters