From 55a16ce573beb4a67b73ab6e56f63707a9b6d79c Mon Sep 17 00:00:00 2001 From: Jeremy Jay Date: Wed, 13 Jul 2016 10:55:22 -0400 Subject: [PATCH] fix nil pointer --- drawing/draw.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drawing/draw.go b/drawing/draw.go index d05e23f..0713bb7 100644 --- a/drawing/draw.go +++ b/drawing/draw.go @@ -167,7 +167,9 @@ func (s *Settings) prepare(changelist []string, g *data.PfamGraphicResponse) *di d.ticks = append(d.ticks, Tick{Pos: int(tstart), Pri: 1}) d.ticks = append(d.ticks, Tick{Pos: int(tend), Pri: 1}) } - s.legendInfo[r.Type] = BlendColorStrings(r.Color, "#FFFFFF") + if s.legendInfo != nil { + s.legendInfo[r.Type] = BlendColorStrings(r.Color, "#FFFFFF") + } } } @@ -232,7 +234,7 @@ func (s *Settings) prepare(changelist []string, g *data.PfamGraphicResponse) *di } } - if label != r.Metadata.Description { + if s.legendInfo != nil && label != r.Metadata.Description { s.legendInfo[r.Metadata.Description] = r.Color } d.domainLabels = append(d.domainLabels, label)