Added null pointer check when settings item is clicked.