Exact steps for others to reproduce the error
- Create Lamp Data Node for any node material
- Select any scene lamp in Lamp Data Node
- Switch to Material mode
- Remove that lamp from the scene
After research I found that it happens because field "users" of linked lamp not incremented when lamp is being selected in Lamp Node.
Nevertheless after opening saved file "users" restores correct number of links and lamp origin becomes blue. IMO increasing and decreasing of "us" field should be in combobox event handler of "Lamp Data" shader node,
but I've not found any good infrastacture for this yet.