if(var.getValue() == null)
if(var == null || var.getValue() == null)
	public Sequence eval(		Sequence contextSequence,		Item contextItem)		throws XPathException {		RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);		// session object is read from global variable $session		Variable var = myModule.resolveVariable(RequestModule.SESSION_VAR);		if(var.getValue() == null)			throw new XPathException("Session not set");		if(var.getValue().getItemType() != Type.JAVA_OBJECT)			throw new XPathException("Variable $session is not bound to a Java object.");		JavaObjectValue session = (JavaObjectValue) var.getValue().itemAt(0);				// get attribute name parameter		String attrib = getArgument(0).eval(contextSequence, contextItem).getStringValue();		Sequence value = getArgument(1).eval(contextSequence, contextItem);		if(session.getObject() instanceof SessionWrapper)			((SessionWrapper)session.getObject()).setAttribute(attrib, value);		else			throw new XPathException("Type error: variable $session is not bound to a session object");		return Sequence.EMPTY_SEQUENCE;	}