Skip to content

Commit

Permalink
add type cast check
Browse files Browse the repository at this point in the history
  • Loading branch information
sivukhin authored and hhrutter committed Jan 27, 2024
1 parent ef759de commit ef9bfc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/pdfcpu/model/equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
"fmt"
"strings"

"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types"
"github.com/pkg/errors"

"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types"
)

// EqualObjects returns true if two objects are equal in the context of given xrefTable.
Expand Down Expand Up @@ -141,7 +142,7 @@ func equalFontNames(v1, v2 types.Object, xRefTable *XRefTable) (bool, error) {
if err != nil {
return false, err
}
bf2 := v2.(types.Name)
bf2, ok := v2.(types.Name)
if !ok {
return false, errors.Errorf("equalFontNames: type cast problem")
}
Expand Down

0 comments on commit ef9bfc9

Please sign in to comment.