diff options
Diffstat (limited to 'wqflask/db')
-rw-r--r-- | wqflask/db/webqtlDatabaseFunction.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/db/webqtlDatabaseFunction.py b/wqflask/db/webqtlDatabaseFunction.py index 122c546f..878792b4 100644 --- a/wqflask/db/webqtlDatabaseFunction.py +++ b/wqflask/db/webqtlDatabaseFunction.py @@ -31,8 +31,9 @@ def retrieve_species(group): cursor.execute( "SELECT Species.Name FROM Species, InbredSet WHERE InbredSet.Name = %s AND InbredSet.SpeciesId = Species.Id", (group,)) - return cursor.fetchone()[0] - return result + results = cursor.fetchone() + if results and results[0]: + return results[0] def retrieve_species_id(group): |