fixed nullexception when item is not accessible due to security

When an item is placed under security the getitem will return null, causing the check on the fields to cause a nullreferenceexception. Checking for null on versionItem resolves this issue.