mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 19:22:01 +00:00
[C++, JSON] Fix nullptr access when reading a key with a default value. (#6375)
This commit fixes handling of default and NULL `key` fields in `Parser::ParseVector` (#5928). The JSON generator updated. It outputs `key` fields even if the `--force-defaults` option is inactive. Additional test cases for `key` added.
This commit is contained in:
@@ -59,7 +59,7 @@ struct Ability {
|
||||
table Stat {
|
||||
id:string;
|
||||
val:long;
|
||||
count:ushort;
|
||||
count:ushort (key);
|
||||
}
|
||||
|
||||
table Referrable {
|
||||
@@ -117,6 +117,7 @@ table Monster {
|
||||
vector_of_enums:[Color] (id:47);
|
||||
signed_enum:Race = None (id:48);
|
||||
testrequirednestedflatbuffer:[ubyte] (id:49, nested_flatbuffer: "Monster");
|
||||
scalar_key_sorted_tables:[Stat] (id: 50);
|
||||
}
|
||||
|
||||
table TypeAliases {
|
||||
|
||||
Reference in New Issue
Block a user