fix segfault, add initialize var && compare with NULL
Qt UI: possible fix for search nick in chat