#vulnerable code 
                             public Promise synwrite(BaseMessage message){
		Channel ch = fetchOneWritable();
		AbstractSessionStateManager session = (AbstractSessionStateManager)ch.pipeline().get(sessionHandler);
		return session.writeMessagesync( message);
	} 
                            #location 3 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public Promise synwrite(BaseMessage message){
		Channel ch = fetchOneWritable();
		if(ch == null) return null;
		AbstractSessionStateManager session = (AbstractSessionStateManager)ch.pipeline().get(sessionHandler);
		return session.writeMessagesync( message);
	}