I think Richard Patten wrote:
> 
> Hello, 
>     I have the following command in my JAVA program.
> 
>     if ( (r.fetch("CustomObject2")) == null){  
>       //code here
>     }
>     // r is an instance of the Rete class;
> 
>     The thing is that the code throws a NullPointerException (the r.fetch command 
>seems to be throwing a NullPointerException instead of just returning null), is there 
>anyway that I could stop this.
> thanks


fetch is a one-line function:

    public Value fetch(String name) {
        return (Value)  m_storage.get(name);
    }

m_storage is an instance of Map, and it's never null (it's constructed
with the Rete object, and never set to another value.) If you're
seeing a NPE at this line in your application, the most likely
explanation is that r itself is null -- check over your code
carefully, and examine the stack trace again.

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to