Fixed crash when cancel is clicked without searching.

Change-Id: I67ca901270874794ec55d5b7db2cd18e6d3a997d