correctly check if lastFilter is undefined
Merge pull request #1354 from franckuser16/master

correctly check if lastFilter is undefined