Why do you compare generalContent with null? It is unnecessary in this case, because you will get NPE in sessionTagsTextBox.getText().trim()