[rafiki]Added check to fix the null error.

Added check to fix the null error when clicking on an empty spot on the list.