Skip to content

Commit

Permalink
Merge pull request #1507 from nextstrain/fix/csv-output-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov authored Jul 11, 2024
2 parents 31c64b3 + 36c474f commit 454e143
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/nextclade-web/src/state/persist/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { recoilPersist } from 'recoil-persist'
import { PROJECT_NAME } from 'src/constants'

export const { persistAtom } = recoilPersist({
key: `${PROJECT_NAME}-storage-v4`, // increment this version on breaking changes
key: `${PROJECT_NAME}-storage-v5`, // increment this version on breaking changes
})
9 changes: 4 additions & 5 deletions packages/nextclade/src/io/nextclade_csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ impl CsvColumnConfig {

let categories = categories
.into_iter()
.filter(|category| !matches!(category, CsvColumnCategory::Dynamic)) // Dynamic columns are handled specially
.map(|category| {
let columns = CSV_COLUMN_CONFIG_MAP_DEFAULT.get(&category).unwrap().clone();
(category, columns)
.filter_map(|category| {
let columns = CSV_COLUMN_CONFIG_MAP_DEFAULT.get(&category)?.clone();
Some((category, columns))
})
.collect();

Expand Down Expand Up @@ -356,7 +355,7 @@ fn rel_mut_cols(desc: &AuspiceRefNodeSearchDesc) -> [String; 5] {
}

fn insert_after<T>(v: &mut Vec<T>, index: usize, val: T) {
if index > v.len() {
if index >= v.len() {
v.push(val);
} else {
v.insert(index + 1, val);
Expand Down

0 comments on commit 454e143

Please sign in to comment.