glejeune/Ruby-Graphviz — Issue #38: Can't assign nil to node attributes
Author: neilconway
Created: 2012-02-01 22:31:33+00:00
State: open

```
require 'rubygems'
require 'graphviz'

# Create a new graph
g = GraphViz.new( :G, :type => :digraph )

# Create two nodes
hello = g.add_node( "Hello" )
hello.color = nil
world = g.add_node( "World" )

# Create an edge between the two nodes
g.add_edge( hello, world )

# Generate output image
g.output( :png => "hello_world.png" )
```

With 0.9.21, this works; with 1.0.4, this raises an exception:

```
graphviz/attrs.rb:62:in `[]=': Invalide value `` for attribute `color` : undefined method `empty?' for nil:NilClass (AttributeException)
```

This breaks backward compatibility.