Skip to content

Commit

Permalink
Fix AmiVector::nvec_ for size 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Oct 8, 2024
1 parent 2784887 commit 1eea0a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_sbml_semantic_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- develop
- master
- release**
- fix_2534_empty_x
pull_request:
paths:
- .github/workflows/test_sbml_semantic_test_suite.yml
Expand Down
8 changes: 3 additions & 5 deletions src/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ void AmiVector::copy(AmiVector const& other) {
void AmiVector::synchroniseNVector(SUNContext sunctx) {
if (nvec_)
N_VDestroy_Serial(nvec_);
nvec_ = vec_.empty()
? nullptr
: N_VMake_Serial(
gsl::narrow<long int>(vec_.size()), vec_.data(), sunctx
);
nvec_ = N_VMake_Serial(
gsl::narrow<long int>(vec_.size()), vec_.data(), sunctx
);
}

AmiVector::~AmiVector() {
Expand Down

0 comments on commit 1eea0a6

Please sign in to comment.