We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current implemention has a logic error where it will squash the found mapping file:
private Dictionary<string, string> GetMappingFileData() { if (_UserMappings == null && System.IO.File.Exists(Options.UserMappingFile)) { var fileData = System.IO.File.ReadAllText(Options.UserMappingFile); try { var fileMaps = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IdentityMapData>>(fileData); _UserMappings = fileMaps.ToDictionary(x => x.Source.FriendlyName, x => x.target?.FriendlyName); } catch (Exception) { _UserMappings = new Dictionary<string, string>(); Log.LogError($"TfsUserMappingTool::GetMappingFileData [UserMappingFile|{Options.UserMappingFile}] <-- invalid - No mapping are applied!"); } } else { Log.LogError($"TfsUserMappingTool::GetMappingFileData::No User Mapping file Provided! Provide file or disable TfsUserMappingTool"); _UserMappings = new Dictionary<string, string>(); } return _UserMappings; }
proposed replacement is :
private Dictionary<string, string> GetMappingFileData() { if (!System.IO.File.Exists(Options.UserMappingFile)) { Log.LogError($"TfsUserMappingTool::GetMappingFileData::No User Mapping file Provided! Provide file or disable TfsUserMappingTool"); _UserMappings = new Dictionary<string, string>(); } if (_UserMappings == null ) { var fileData = System.IO.File.ReadAllText(Options.UserMappingFile); try { var fileMaps = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IdentityMapData>>(fileData); _UserMappings = fileMaps.ToDictionary(x => x.Source.FriendlyName, x => x.target?.FriendlyName); } catch (Exception) { _UserMappings = new Dictionary<string, string>(); Log.LogError($"TfsUserMappingTool::GetMappingFileData [UserMappingFile|{Options.UserMappingFile}] <-- invalid - No mapping are applied!"); } } return _UserMappings; }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Current implemention has a logic error where it will squash the found mapping file:
proposed replacement is :
The text was updated successfully, but these errors were encountered: