fix null adapter, add a test