Steps I did:
Created new Environment
Opened Agent Mapping UI
Deleted Default Environment in Configuration Manager UI
As I remember correctly the default mapping entry in the Agent Mapping UI disappeared
Created a new mapping entry (the one visible in the screenshot)
Triggered saving of the Agent Mapping UI
Exception PopUp occured
NPE on mapping event
Agent mapping dialog should be opened also on the double click of the mapping table
I know what it is, should be easy to fix.
I don't know if it's related to this but it seams like we can get a NPE when we fire the Agent Mapping update event. It should be something with the same problem imo.
I was able to reproduce this. Same problem will happen if the profile is deleted and environment is edited that was using this profile. Should be easy fix in both cases.