diff options
author | Alexander Kabui | 2024-09-23 12:17:57 +0300 |
---|---|---|
committer | GitHub | 2024-09-23 12:17:57 +0300 |
commit | 66cd75d1a0be493c1740fe245c9d58f1a5dd3409 (patch) | |
tree | dc4f7055fcb6c204d8f24cfe06124637b482b3a2 | |
parent | 738ed2451eeb305450404f6601369aa40ca25c09 (diff) | |
parent | a6401533301c08af4c858f9fa6f9c8e37dd2513e (diff) | |
download | genenetwork2-66cd75d1a0be493c1740fe245c9d58f1a5dd3409.tar.gz |
Merge pull request #876 from genenetwork/chores/fix-do-ai-search
Fix cases where index for '.' and ',' do not exist for do_ai_search.
-rw-r--r-- | gn2/wqflask/templates/gsearch_gene.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gn2/wqflask/templates/gsearch_gene.html b/gn2/wqflask/templates/gsearch_gene.html index 13b56b42..e4039f71 100644 --- a/gn2/wqflask/templates/gsearch_gene.html +++ b/gn2/wqflask/templates/gsearch_gene.html @@ -290,11 +290,13 @@ let header_length = 40; let max_header_length = 180; while (header_length <= search_result.length) { - let next_dot = search_result.indexOf(".", header_length+1); - + let next_dot = search_result.indexOf(".", header_length+1); + if (next_dot == -1) { + next_dot = search_result.length+1 + } if (next_dot > max_header_length) { let next_comma = search_result.indexOf(",", header_length+1); - if (next_comma > max_header_length) { + if (next_comma > max_header_length || next_comma == -1) { break; } header_length = next_comma; |