value null check

Hi,Daniel Mircea.
Here is my propose file change. 
Add null check of value (line: 32)
if value is null, there is a type error.
(Uncaught TypeError: Cannot read property '__klass__' of null)
Thank you.
Merge pull request #1 from ggany/patch-1

Value null check