SI-6576 Workaround / diagnostic for IDE NPE.

Seems like this was too optimistic:

> // later by lukas: disabled when fixing SI-5975
> // i think it cannot happen anymore

 - restored the null check
 - added logging when we set the namer in this attachment,
   in the hope of spotting a pattern in the wild.

We don't have a test case yet; if we did we could most likely
have a more principled fix. But this should suffice for 2.10.1.
Merge pull request #2138 from retronym/ticket/6576-null-strikes-back

SI-6576 Workaround / diagnostic for IDE NPE.