I would check for null or empty explicitly and then let the exception
happen. Silently failing is almost never a good way to go.


On Mon, Mar 3, 2014 at 9:31 AM, alxdarksage <notifications@github.com>wrote:

> In
> src/main/java/org/sagebionetworks/bridge/webapp/converter/DoubleConverter.java:
>
> >  			return null;
> >  		}
> >  		ParticipantDataDoubleValue pdv = new ParticipantDataDoubleValue();
> > -		pdv.setValue(Double.parseDouble(values.get(0)));
> > +		try {
> > +			pdv.setValue(Double.parseDouble(values.get(fieldName)));	
> > +		} catch(NumberFormatException t){
>
> We could log it, but it happens if an empty string is passed to the method
> and could happen if someone enters junk and there's no other validation
> happening. I could trap the empty string above. It doesn't really matter:
> however handled, it's a null.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Sage-Bionetworks/Bridge/pull/99/files#r10219440>
> .
>