Add a null-check to fix a regression in 4de92b7.

The regression (NRE) occurs if null is passed as the argument to an
attribute constructor taking a type:

    [SomeAttribute (null)]
Merge pull request #163 from rolfbjarne/null-type-to-attribute-regression-fix

Add a null-check to fix a regression in 4de92b7.