{"action":"closed","issue":{"url":"https://api.github.com/repos/anjdreas/UnitsNet/issues/98","labels_url":"https://api.github.com/repos/anjdreas/UnitsNet/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/anjdreas/UnitsNet/issues/98/comments","events_url":"https://api.github.com/repos/anjdreas/UnitsNet/issues/98/events","html_url":"https://github.com/anjdreas/UnitsNet/issues/98","id":99198430,"number":98,"title":"Thread-safety issue","user":{"login":"istanishev","id":11559492,"avatar_url":"https://avatars.githubusercontent.com/u/11559492?v=3","gravatar_id":"","url":"https://api.github.com/users/istanishev","html_url":"https://github.com/istanishev","followers_url":"https://api.github.com/users/istanishev/followers","following_url":"https://api.github.com/users/istanishev/following{/other_user}","gists_url":"https://api.github.com/users/istanishev/gists{/gist_id}","starred_url":"https://api.github.com/users/istanishev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istanishev/subscriptions","organizations_url":"https://api.github.com/users/istanishev/orgs","repos_url":"https://api.github.com/users/istanishev/repos","events_url":"https://api.github.com/users/istanishev/events{/privacy}","received_events_url":"https://api.github.com/users/istanishev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-05T12:53:28Z","updated_at":"2015-09-09T07:16:57Z","closed_at":"2015-09-09T07:16:57Z","body":"UnitSystem class is using static Dictionary [here](https://github.com/anjdreas/UnitsNet/blob/b2d853bd7d1f9bc494377ecec51ff1ac8241fdd3/UnitsNet/CustomCode/UnitSystem.cs#L37) which makes the class not thread-safe.\r\n\r\nUnitSystem.GetCached is used from the Parse() method which makes the Parse method also not thread-safe.\r\n\r\nThe result is NullReferenceException.\r\n\r\nSample stack trace:\r\nat System.Collections.Generic.Dictionary.Insert(TKey key, TValue value, Boolean add)\r\nat System.Collections.Generic.Dictionary.set_Item(TKey key, TValue value)\r\nat UnitsNet.UnitSystem.GetCached(IFormatProvider cultureInfo)\r\nat UnitsNet.Mass.ParseUnit(String str, IFormatProvider formatProvider)\r\nat UnitsNet.Mass.ParseWithRegex(String regexString, String str, IFormatProvider formatProvider)\r\n..."}}