You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Details getSummaryText throws NullPointerExceptions if summary was not set. #3171
I wanted to implement this code, where I compare the old and new values of summary text.
if (!Objects.equals(newSummaryText, detail.getSummaryText())) {
detail.setSummaryText(newSummaryText);
}
Then I've noticed the getSummaryText throws a nullpointerexception because the summary was not set before. I had to do like this:
if (detail.getSummary() == null || !Objects.equals(newSummaryText, detail.getSummaryText())) {
detail.setSummaryText(newSummaryText);
}
Describe the solution you'd like
I think getSummaryText() should return an empty string (or null) if the summary was not set before.
or/and
Details.setSummaryText should do this comparsion before doing any component creation and logic.
Activity
fix: return empty string if no summary text defined