Opened 2 years ago

Closed 2 years ago

#23844 closed defect (fixed)

Fix NullPointerException thrown by providing invalid parameters

Reported by: karsten Owned by: karsten
Priority: Medium Milestone:
Component: Metrics/ExoneraTor Version:
Severity: Normal Keywords:
Cc: ln5 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Looks like our recent changes from a few weeks ago introduced a NullPointerException when the user provides invalid paramters. For example, this request for IP address throws such an exception. Should be relatively easy to resolve. Reported by ln5.

Child Tickets

Change History (4)

comment:1 Changed 2 years ago by iwakeh

Status: newneeds_review

The problem got introduced in this commit, where the NPE happens when writing the permanent link.

Please review this patch, which avoids providing the permanent link when there was invalid user input.

Last edited 2 years ago by iwakeh (previous) (diff)

comment:2 Changed 2 years ago by iwakeh

This side-by-side diff makes the problematic change better visible; focus on old line 191, which is erased.

comment:3 Changed 2 years ago by karsten

Owner: changed from metrics-team to karsten
Status: needs_reviewaccepted

Thanks for analyzing this bug! I applied a slightly different change that is closer to what we previously did. In fact, with the current code (before my change) we were writing to a closed output stream, which we shouldn't do.

I deployed the fix.

However, we now say that we couldn't connect to the database (= backend) when in fact we didn't even attempt to connect, because we didn't receive valid parameters. Should be an easy fix which I'll make after lunch. At least the exception is gone now.

comment:4 Changed 2 years ago by karsten

Resolution: fixed
Status: acceptedclosed

Alright, I fixed that newly discovered issue, too. All resolved now. Closing.

Note: See TracTickets for help on using tickets.