Skip to content

json::parse on failed stream gets stuck #366

@popizdeh

Description

@popizdeh

Creating a file stream for file that doesn't exist results in stream object whose fail() method returns true. json::parse never returns when called on such a stream. Adding a check for m_stream.fail() (in addition to eof()) in fill_line_buffer seems to do the trick, invalid_argument exception gets thrown. Not sure if this is the right fix, it might also make sense checking that stream isn't 'bad' (not sure what causes this to happen as bad() for missing file stream returns false).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions