From 1eea0a6d7e12a780fd317ac4244d66b09424a2a8 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 8 Oct 2024 13:43:01 +0200 Subject: [PATCH] Fix AmiVector::nvec_ for size 0 --- .github/workflows/test_sbml_semantic_test_suite.yml | 1 + src/vector.cpp | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_sbml_semantic_test_suite.yml b/.github/workflows/test_sbml_semantic_test_suite.yml index 69c78d44b4..5d7b704151 100644 --- a/.github/workflows/test_sbml_semantic_test_suite.yml +++ b/.github/workflows/test_sbml_semantic_test_suite.yml @@ -5,6 +5,7 @@ on: - develop - master - release** + - fix_2534_empty_x pull_request: paths: - .github/workflows/test_sbml_semantic_test_suite.yml diff --git a/src/vector.cpp b/src/vector.cpp index 199a50b31b..264e1e57e1 100644 --- a/src/vector.cpp +++ b/src/vector.cpp @@ -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(vec_.size()), vec_.data(), sunctx - ); + nvec_ = N_VMake_Serial( + gsl::narrow(vec_.size()), vec_.data(), sunctx + ); } AmiVector::~AmiVector() {