Fixed NPE in test when value is null

Change-Id: I04e1f365535878a46744046ee271387c21d31956