Fix possible NPE reference or incompatible types equality check.

UpdateRefWeb was calling equals against newRef (String) and ObjectId.NULL (ObjectId)
and didn't check newRef for nullity.