This is getting passed null on some internal flows (when looking at `window`). Can you guard for it? `if (id && ..)`?