Fix getPrimitiveProperty methods null exception

Check if the value is null before calling getValue(). This prevents a null exception on items that are null.