fix truncate to handle null

after migrating to gorm we are now doing some transformations in the
accept where certain items might be null.  We are also now doing a
check before transforming any data.