mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 19:46:07 +00:00
Add null checks and fix CodeAnalysis errors.
I enabled code analysis to the Octokit.Reactive project and needed to fix things up.
This commit is contained in:
@@ -6,6 +6,8 @@ namespace Octokit
|
||||
{
|
||||
public static TValue SafeGet<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
|
||||
{
|
||||
Ensure.ArgumentNotNull(dictionary, "dictionary");
|
||||
|
||||
TValue value;
|
||||
return dictionary.TryGetValue(key, out value) ? value : default(TValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user