You may need to update your trigger to account for when the total weight is zero. The error means that the weight was equal to zero... but I guess you figured that part out. Now you just need to account for not calling that code when the weight is equal to zero. This is done in the trigger for the shipping calculation server behavior and requires a small amount of hand coding since that is not one of the default triggers.