Quick fix to elimated a panic. [issue-122]
We now check to see if the pointer is nil before dereferencing it.
@@ -17,6 +17,9 @@ func (t *Tile) AddLayers(layers ...*Layer) error {
// Need to make sure that all layer names are unique.
for i := range layers {
nl := layers[i]
+ if nl == nil {
+ continue
+ }
for i, l := range t.layers {
if l.Name == nl.Name {
return fmt.Errorf("Layer %v, already is named %v, new layer not added.", i, l.Name)
