OS-229: fix for possible comparison of null variables.

Change-Id: I78bc25a83bd5df74768ecfe53022063707043279