Opened 11 years ago

Closed 11 years ago

#468 closed enhancement (fixed)

NullPointerException when registering Caliper results if Plate name value is missing

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: Reggie v2.12
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

If the WellTable.csv contains a row with an empty Plate name value, the importer fails with a NullPointerException. In the GUI, this is just visible as an empty red box. In the log file on the server the following is logged:

java.lang.NullPointerException
	at java.util.regex.Matcher.getTextLength(Unknown Source)
	at java.util.regex.Matcher.reset(Unknown Source)
	at java.util.regex.Matcher.<init>(Unknown Source)
	at java.util.regex.Pattern.matcher(Unknown Source)
	at net.sf.basedb.reggie.plugins.CaliperPlateImporter.getBasePlateName(CaliperPlateImporter.java:320)
	at net.sf.basedb.reggie.plugins.CaliperPlateImporter.checkBioPlate(CaliperPlateImporter.java:365)
	at net.sf.basedb.reggie.plugins.CaliperPlateImporter.doImport(CaliperPlateImporter.java:211)
	at net.sf.basedb.reggie.servlet.RnaQcServlet.doPost(RnaQcServlet.java:408)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
....

When checking the Plate name there should be an explicit check for null before attempting to match it against the pattern. The final result is still an exception (Line XXX: Plate name doesn't match expected pattern (CaliperPlateNNNN)), but this will be visible in the GUI and gives enough information for the problem to be understood and fixed without having to check log files, etc.

Change History (1)

comment:1 by Nicklas Nordborg, 11 years ago

Resolution: fixed
Status: newclosed

(In [1888]) Fixes #468: NullPointerException when registering Caliper results if Plate name value is missing

Note: See TracTickets for help on using tickets.