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

runtime error: invalid memory address or nil pointer dereference #28

Closed
rorycl opened this issue Feb 21, 2020 · 1 comment
Closed

runtime error: invalid memory address or nil pointer dereference #28

rorycl opened this issue Feb 21, 2020 · 1 comment

Comments

@rorycl
Copy link

rorycl commented Feb 21, 2020

The file at http://www.campbell-lange.net/media/files/example6.pdf causes the following error:

file: /tmp/f4a42574-28b8-4fc8-8322-fdbd885f10f3.pdf
   pages:   2
   page :   1 processed
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x5407b6]

goroutine 1 [running]:
github.com/phpdave11/gofpdi.(*PdfReader).rebuildContentStream(0xc00007a1e0, 0xc0002623c0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdi@v1.0.11/reader.go:1376 +0xb6
github.com/phpdave11/gofpdi.(*PdfReader).getContent(0xc00007a1e0, 0x2, 0xc00022d860, 0x0, 0x0, 0x1)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdi@v1.0.11/reader.go:1329 +0x1f3
github.com/phpdave11/gofpdi.(*PdfWriter).ImportPage(0xc00016cc80, 0xc00007a1e0, 0x2, 0x5c1e52, 0x9, 0x1, 0x0, 0x0)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdi@v1.0.11/writer.go:148 +0x163
github.com/phpdave11/gofpdi.(*Importer).ImportPage(0xc0000a5480, 0x2, 0x5c1e52, 0x9, 0x0)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdi@v1.0.11/importer.go:122 +0x103
github.com/phpdave11/gofpdf/contrib/gofpdi.(*Importer).getTemplateID(0xc00009e570, 0x60a0c0, 0xc000124000, 0x2, 0x5c1e52, 0x9, 0x7)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdf@v1.4.1-0.20200211150905-48c1f7f2764c/contrib/gofpdi/gofpdi.go:61 +0x50
github.com/phpdave11/gofpdf/contrib/gofpdi.(*Importer).ImportPage(0xc00009e570, 0x60a0c0, 0xc000124000, 0x7fffdeeeb5f7, 0x2d, 0x2, 0x5c1e52, 0x9, 0x0)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdf@v1.4.1-0.20200211150905-48c1f7f2764c/contrib/gofpdi/gofpdi.go:45 +0x89
github.com/phpdave11/gofpdf/contrib/gofpdi.ImportPage(...)
	/home/rory/go/pkg/mod/github.com/phpdave11/gofpdf@v1.4.1-0.20200211150905-48c1f7f2764c/contrib/gofpdi/gofpdi.go:115
main.main()
	/home/rory/src/go-gofpdi-test/gofpdi-t3.go:47 +0x214

Please note that this file will be removed shortly.

@rorycl
Copy link
Author

rorycl commented Jun 15, 2020

Closing as #37 has an example file.

@rorycl rorycl closed this as completed Jun 15, 2020
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