Fix issue #1381; readded if check on light level return value

Fix issue #1381; readded if check on light level return value