Skip to content

Correct json array parsing#140

Open
fattredd wants to merge 1 commit intomlomb:mainfrom
fattredd:jsonstream_array_fix
Open

Correct json array parsing#140
fattredd wants to merge 1 commit intomlomb:mainfrom
fattredd:jsonstream_array_fix

Conversation

@fattredd
Copy link

When JSONStream tries to read an empty array, it failed because it was trying to parse the empty string. To correct this, we just need to double check in State.END_VALUE_ARRAY that there's actually something to parse.

When DiscordChatExporter encounters an empty channel (or DM, voice chat, or otherwise), it still creates a file, but the messages field is set to []. This fix makes sure that we can still parse it.

Also included tests for this case.

Related: #139

When JSONStream tries to read an empty array, it failed because it was
trying to parse the empty string. To correct this, we just need to
double check in State.END_VALUE_ARRAY that there's actually something
to parse.

When DiscordChatExporter encounters an empty channel (or DM, voice chat,
or otherwise), it still creates a file, but the messages field is set to
`[]`. This fix makes sure that we can still parse it.

One potential issue is that we may be breaking the way that
`pipeline/Time.ts` is used with reference to figuring out the min/max
time.

Also included tests for this case.
@Lucifer1590
Copy link

i agree it fails to parse empty array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants