I do a middleware call as to get an array of String as shown:
String[] freqwords = MViewer.getWordNames();
The issue is that there might be no data available, so any further operations like freqWords.length, may result in NullPointerException.
So to avoid that I am handling in this below way as shown:
if (freqwords == null)
{
freqwords = new String[0];
}
The code is working fine - please let me know if there is any better approach or any negative scenarios with this.