From 6c1cee5f79d8bbdc78f96640b52e49441d70247c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Mon, 6 May 2024 04:26:41 +0800 Subject: [PATCH] fix: crash in printTorrentList() (#6819) * Fix crash in printTorrentList * code review: accept nullptr setme --- libtransmission/variant.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/variant.cc b/libtransmission/variant.cc index ee207d9b4..bf2daf69c 100644 --- a/libtransmission/variant.cc +++ b/libtransmission/variant.cc @@ -57,7 +57,10 @@ template { if (auto val = var->value_if()) { - *setme = *val; + if (setme) + { + *setme = *val; + } return true; } }