From 8a7e75e84a31180d51b9970d526709ec4dca2030 Mon Sep 17 00:00:00 2001 From: Michele Papalini Date: Thu, 2 Feb 2023 17:49:46 +0100 Subject: fix(hicn): fix bugs reported by sonarqube Ref: HICN-837 Signed-off-by: Michele Papalini Change-Id: I0d02a11361b1ba5ad50123b2dd142c961998922f --- libtransport/src/core/pending_interest.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libtransport/src/core/pending_interest.h') diff --git a/libtransport/src/core/pending_interest.h b/libtransport/src/core/pending_interest.h index b901e7d97..f49348bac 100644 --- a/libtransport/src/core/pending_interest.h +++ b/libtransport/src/core/pending_interest.h @@ -62,7 +62,13 @@ class PendingInterest { timer_.async_wait(std::forward(cb)); } - void cancelTimer() { timer_.cancel(); } + void cancelTimer() { + try { + timer_.cancel(); + } catch (asio::system_error &e) { + // do nothing + } + } Interest::Ptr &&getInterest() { return std::move(interest_); } -- cgit 1.2.3-korg