Put a couple of if statements to make sure you have any to transactions to update before spinning through them.  This is because it will throw an exception if the list is null when trying to do a linq query within the foreach statement.