Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPORT-848: added try catch statements to catch NullPointerException #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mozzy11
Copy link
Member

@mozzy11 mozzy11 commented Mar 24, 2019

@@ -148,5 +151,10 @@ else if (successUrl.startsWith(pathToRemove)) {
}
design = rs.saveReportDesign(design);
return "redirect:" + successUrl;
}catch(PropertyValueException e) {
Copy link
Member

Choose a reason for hiding this comment

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

@mozzy11 , what happens when a NullPointerException is thrown instead?

@@ -213,5 +215,9 @@ else if (successUrl.startsWith(pathToRemove)) {
}
design = rs.saveReportDesign(design);
return "redirect:" + successUrl;
}catch(PropertyValueException e) {
Copy link
Member

Choose a reason for hiding this comment

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

Same applies here and anywhere else in this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

I did several testing of that , and instead of a Null Pointer Exception being throen when an empty parameter is passed to the controller, its a PropertyValueEception that is thrown . i think the NPE is already manged by the util methods used there in that specific controller where i was catching the propertValueException

@@ -137,6 +140,10 @@ public String editReportDesign(ModelMap model,
url.append("&returnUrl=" + returnUrl);
}
return "redirect:"+url.toString();
}catch(NullPointerException e){
Copy link
Member Author

Choose a reason for hiding this comment

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

it was only here , where an empty parameter passed to the controller throws a NPE

@gracepotma
Copy link

@dkayiwa can this be merged? Screenshot provided in comments here: https://issues.openmrs.org/browse/REPORT-848

@dkayiwa
Copy link
Member

dkayiwa commented Apr 2, 2021

@gracepotma cannot be merged with merge conflicts. 😊

@gracepotma
Copy link

@mozzy11 can you address the merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants