Fixed #1728: fixed null pointer exception on search

Make sure that _currentExpandedState is never null.

review: @devoncarew