Ignore:
Timestamp:
Jun 9, 2010, 5:17:29 PM (8 years ago)
Author:
jahn
Message:

Remvoed bug in getStudy(). If a non-valid id is passed as argument, we don't get an exception anymore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/RestController.groovy

    r523 r549  
    6262                        def id = Long.parseLong(params.externalStudyID)
    6363                        def study = Study.find( "from Study as s where s.externalStudyID=?", [id])
    64                         study.subjects.each { subjects.push it.name }
     64                        if(study) study.subjects.each { subjects.push it.name }
    6565                }
    6666                render subjects as JSON
     
    8282                        def id = Long.parseLong(params.externalStudyID)
    8383                        def study = Study.find( "from Study as s where s.externalStudyID=?", [id])
    84                         study.assays.each{ assay -> assays.push assay.externalAssayID }
     84                        if(study) study.assays.each{ assay -> assays.push assay.externalAssayID }
    8585                }
    8686                render assays as JSON
Note: See TracChangeset for help on using the changeset viewer.