Skip to content

Commit

Permalink
[Foundation] Add null check for Observer cback (#7)
Browse files Browse the repository at this point in the history
* [Foundation] Add null check to Observer cback

* [Foundation] Rename parameter name from cback to observer
  • Loading branch information
olegoid authored and rolfbjarne committed Apr 28, 2016
1 parent 46c4269 commit 1ad1df2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Foundation/NSObject2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,14 @@ class Observer : NSObject {
Action<NSObservedChange> cback;
NSString key;

public Observer (NSObject obj, NSString key, Action<NSObservedChange> cback)
public Observer (NSObject obj, NSString key, Action<NSObservedChange> observer)
{
if (observer == null)
throw new ArgumentNullException (nameof(observer));

this.obj = new WeakReference (obj);
this.key = key;
this.cback = cback;
this.cback = observer;
IsDirectBinding = false;
}

Expand Down

0 comments on commit 1ad1df2

Please sign in to comment.