add null check for compareSource field

Signed-off-by: Jamie <jamiemthomas@hotmail.com>