Avoid npe for non-file editors and for closed projects when doing a quick search