[Mono-osx] Why a Null Value

Eric Hosick erichosick at gmail.com
Sat Aug 27 13:00:14 EDT 2011


Hi All,

I have the following code:

class AggregateHashtable {
  private Hashtable p_wrappedInstance = new Hashtable();

  public AggregateHashtable() {
    if ( null == p_wrappedInstance ) {
      throw new Exception ("How did this get to be null?"); // Just to check
if this is ever happening.
    }
  }
  [XmlIgnore] public Hashtable wrappedInstance {
    get { return p_wrappedInstance; }
  }

  // other code but never accesses p_wrappedInstance
}

During runtime somewhere in the code:

get {
AggregateHashtable iHashTable = ccmRoot.root as AggregateHashtable;
if ( null == iHashTable.wrappedInstance ) {
throw new Exception ("There is no way this can be null!");
}



Any ideas?

Thanks,

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110828/16539b47/attachment.html 


More information about the Mono-osx mailing list