user/charge: implicitly exclude the NULL user from accounting
This is for now only useful to allow tests without accounting, but one could imagine
we would want to exclude some sockets from accounting alltogether. Such as the controller
socket.
@@ -241,6 +241,11 @@ int user_charge(User *user,
_c_cleanup_(user_usage_unrefp) UserUsage *usage = NULL;
int r;
+ /* excluded from accounting */
+ if (!user)
+ return 0;
+
+ /* charge to itself */
if (!actor)
actor = user;
