I’m trying to do the fill-in with the Edit Fields node. I tried your method but it doesn’t work. It doesn’t work with item 2 and the rest of the items.
Your original question just said the field could be set to null. It didn’t mention the field could be missing. Anyway, that just requires another condition in the expression to check for undefined.
There is a somewhat lengthy discussion of the subtleties of checking for null, undefined, etc. here. If you still find that the expression isn’t quite right you can find some other ways to try in that thread. For instance, $json.token === undefined || $json.token === nullCOULD possibly be rewritten as $json.token == null (i.e. == instead of ===) or typeof($json.token) === 'undefined' || $json.token === null (i.e. explicit use of typeof, compared to string result). In any case, it would probably serve you to review the Javascript docs on operators.