Skip to content

Commit

Permalink
draw/image: in scalar output before accessing colormap, check if it p…
Browse files Browse the repository at this point in the history
…oints to something
  • Loading branch information
godsic committed Feb 8, 2018
1 parent 9aa348d commit d38176f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion draw/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func On(img *image.RGBA, f *data.Slice, fmin, fmax string, arrowSize int, colorm

case 1:
min, max := parseMinMax(f, fmin, fmax)
drawFloats(img, f.Scalars(), min, max, colormap[0].Cmap...)
if colormap == nil {
drawFloats(img, f.Scalars(), min, max)
} else {
drawFloats(img, f.Scalars(), min, max, colormap[0].Cmap...)
}
}
}

Expand Down

0 comments on commit d38176f

Please sign in to comment.