better handling if null value

ref to https://github.com/Codiad/Codiad/pull/315