Permalink
Browse files

Add some missing null checks

  • Loading branch information...
1 parent 2a5b9f6 commit 589b5c73573e01deb519bea16549366384819ab8 @cdhowie committed Oct 21, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 Cdh.Toolkit.Extensions/Collections/Extensions.cs
@@ -33,13 +33,17 @@ public static class Extensions
{
public static TValue GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key)
{
+ Check.ArgumentIsNotNull(dict, "dict");
+
TValue value;
dict.TryGetValue(key, out value);
return value;
}
public static TValue GetOrValue<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue fallback)
{
+ Check.ArgumentIsNotNull(dict, "dict");
+
TValue value;
return dict.TryGetValue(key, out value) ? value : fallback;

0 comments on commit 589b5c7

Please sign in to comment.