Skip to content

Commit

Permalink
Bugfix to stop the project page blowing up when we have problems retr…
Browse files Browse the repository at this point in the history
  • Loading branch information
Daz Oakley committed Apr 5, 2011
1 parent af95b22 commit 3d5f4a1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/martsearch/project_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def get_ikmc_project_page_data( project_id )
end

private

# Helper function to perform quick searches against the Solr index
#
# @param [MartSearch::Index] index the MartSearch index object
Expand All @@ -152,20 +152,21 @@ def search_engine_data( index, project_id )
results = handle_biomart_errors( "solr index", "This provides extra information on the project." ) do
index.quick_search("ikmc_project_id:#{project_id}")
end
unless results[:data].empty? or results[:data].nil?

unless results[:data].blank?
results[:data][0].symbolize_keys!

# currently we only need the coordinate information
results[:data] = {
:chromosome => results[:data][0][:chromosome],
:coord_start => results[:data][0][:coord_start],
:coord_end => results[:data][0][:coord_end]
}
end

# currently we only need the coordinate information
results[:data] = {
:chromosome => results[:data][0][:chromosome],
:coord_start => results[:data][0][:coord_start],
:coord_end => results[:data][0][:coord_end]
}


return results
end

# Helper function to setup links to the floxed/deleted exons and all the config
# needed for these activities in the templates.
#
Expand Down

0 comments on commit 3d5f4a1

Please sign in to comment.