From 5e55e70f52efa558da2d3a870f95432d64d48033 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 7 Jul 2023 13:12:23 +0200 Subject: [PATCH] RemoteLinux: Guard against nullptr access This fixes a potential crash when switching the device of a kit. Change-Id: Ibdce9859cb347401706fe4de1c56aa8bb890233b Reviewed-by: hjk --- src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index 1be0624490f..07880089de2 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -38,7 +38,7 @@ public: auto fetchButton = new QPushButton(Tr::tr("Fetch Device Environment")); addWidget(fetchButton); - connect(target, &Target::kitChanged, [aspect] { aspect->setRemoteEnvironment({}); }); + connect(target, &Target::kitChanged, aspect, [aspect] { aspect->setRemoteEnvironment({}); }); connect(fetchButton, &QPushButton::clicked, this, [aspect, target] { if (IDevice::ConstPtr device = DeviceKitAspect::device(target->kit())) {