fix bug when adapter has nothing yet.

fix bug when adapter has nothing yet.