Again, there's nothing to stop var/datum/job/j = null
You need to add a sanity check for it being null.
Otherwise you'll get a null.total_positions runtime