Skip to content

Commit

Permalink
fix nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
pbnjay committed Jul 13, 2016
1 parent 6a556ac commit 55a16ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drawing/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 55a16ce

Please sign in to comment.