[client] Fix a bug when dir object is lost.