FWM-Team / FWM-Backlog-Issues

This is a backlog of issues to deal with
0 stars 0 forks source link

Foreach on "possible" array variables #20

Open FWAJL opened 8 years ago

FWAJL commented 8 years ago

I see a lot of this:

***if(!empty($task_field_analytes)){***
    foreach($task_field_analytes as $analyte){
        //Do stuff
    }   
}

I think it is safer to check if empty _and_ is_array so that you know it is an array. It will avoid having the case where we have a SQL error and the UI breaks. We will log the error in the BaseManager.