Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Avoid NPE if empty sitemap file is loaded #3834

Merged
merged 2 commits into from Jul 12, 2017

Conversation

triller-telekom
Copy link
Contributor

@triller-telekom triller-telekom commented Jul 12, 2017

Fixes #3820

Signed-off-by: Stefan Triller stefan.triller@telekom.de

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
@@ -215,7 +216,7 @@ private void addCallbackToListener(String sitemapName, String pageId, SitemapSub
}

private EList<Widget> collectWidgets(String sitemapName, String pageId) {
EList<Widget> widgets = null;
EList<Widget> widgets = new BasicEList<Widget>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fully makes sense!

Could you please also adapt (i.e. simplify) lines 206-215, not that we know it's never gonna be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable in line 205 is just a local one and there is a check for null before the function does something with this null list .

EDIT: nevermind: you had a typo "not" instead of "now" which confused me :) I changed the code to be aware of that collectWidgets always returns an (empty) list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh, sorry for the confusion!

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
@sjsf sjsf merged commit 2f1aa1d into eclipse-archived:master Jul 12, 2017
@sjsf
Copy link
Contributor

sjsf commented Jul 12, 2017

Thanks!

@triller-telekom triller-telekom deleted the sitemapNPE branch July 13, 2017 08:50
@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants