Skip to content

Commit

Permalink
Fix panic on GetPictureCells without drawing relationships parts
Browse files Browse the repository at this point in the history
  • Loading branch information
TajangSec committed Nov 15, 2023
1 parent 3bdc2c5 commit bb95483
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions picture.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,10 @@ func (f *File) extractDecodeCellAnchor(anchor *xdrCellAnchor, drawingRelationshi
_ = f.xmlNewDecoder(strings.NewReader("<decodeCellAnchor>" + anchor.GraphicFrame + "</decodeCellAnchor>")).Decode(&deCellAnchor)
if deCellAnchor.From != nil && deCellAnchor.Pic != nil {
if cond(deCellAnchor.From) {
drawRel = f.getDrawingRelationships(drawingRelationships, deCellAnchor.Pic.BlipFill.Blip.Embed)
if _, ok := supportedImageTypes[strings.ToLower(filepath.Ext(drawRel.Target))]; ok {
cb(deCellAnchor, drawRel)
if drawRel = f.getDrawingRelationships(drawingRelationships, deCellAnchor.Pic.BlipFill.Blip.Embed); drawRel != nil {
if _, ok := supportedImageTypes[strings.ToLower(filepath.Ext(drawRel.Target))]; ok {
cb(deCellAnchor, drawRel)
}
}
}
}
Expand Down

0 comments on commit bb95483

Please sign in to comment.