Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing fails on Empty pages (without Contents) #37

Open
romanpickl opened this issue Mar 14, 2024 · 0 comments
Open

Parsing fails on Empty pages (without Contents) #37

romanpickl opened this issue Mar 14, 2024 · 0 comments

Comments

@romanpickl
Copy link

romanpickl commented Mar 14, 2024

when looking into the issue described in
tmc/langchaingo#348

i found that the library fails when parsing pages without Contents.

strm := p.V.Key("Contents")

returns a Null Value, which then leads to an error.

So when parsing one either has to check for p.V.Key("Contents").Kind() not being pdf.Null

		if p.V.IsNull() || p.V.Key("Contents").Kind() == pdf.Null {
			continue
		}

or I think the functions using p.V.Key("Contents") should check the returned Kind (or recover from an error)

@romanpickl romanpickl changed the title Parsing fails on Empty pages (without Content) Parsing fails on Empty pages (without Contents) Mar 14, 2024
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

No branches or pull requests

1 participant