Merge "Null check before calling TrustAgentService and throw Security exception if the API is not allowed. Test: manual"