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.