Skip to content

Commit

Permalink
fix(page): correctly handle panic in GetTextByRow
Browse files Browse the repository at this point in the history
  • Loading branch information
lzambarda committed Mar 16, 2022
1 parent 7b000bd commit e3c03b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions page.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,8 @@ type Row struct {
type Rows []*Row

// GetTextByRow returns the page's all text grouped by rows
func (p Page) GetTextByRow() (Rows, error) {
result := Rows{}
var err error
func (p Page) GetTextByRow() (result Rows, err error) {
result = Rows{}

defer func() {
if r := recover(); r != nil {
Expand Down

0 comments on commit e3c03b5

Please sign in to comment.