ActivityPub actually says that null is valid:
https://www.w3.org/TR/activitypub/#obj-id
These identifiers must fall into one of the following groups:
...
An ID explicitly specified as the JSONnullobject, which implies an anonymous object (a part of its parent context)
Some people think this is an error because it's not valid JSON-LD, and there is a proposal to change the text: https://github.com/w3c/activitypub/issues/476
But to be honest I think "Object Identifiers" section is so badly written that it would be much better to replace it completely.