Re #1257 Checking whether an object existing before using it.