@@ -721,11 +721,13 @@ QColor VNode::typeFontColour() const {
721721}
722722
723723bool VNode::userLogServer (std::string& host, std::string& port) {
724- if (ServerHandler* sh = server ()) {
725- host = sh->conf ()->stringValue (VServerSettings::UserLogServerHost).toStdString ();
726- if (!host.empty ()) {
727- port = sh->conf ()->stringValue (VServerSettings::UserLogServerPort).toStdString ();
728- return !port.empty ();
724+ if (auto * sh = server (); sh) {
725+ if (auto * conf = sh->conf (); conf) {
726+ host = conf->stringValue (VServerSettings::UserLogServerHost).toStdString ();
727+ if (!host.empty ()) {
728+ port = conf->stringValue (VServerSettings::UserLogServerPort).toStdString ();
729+ return !port.empty ();
730+ }
729731 }
730732 }
731733 return false ;
@@ -1199,7 +1201,10 @@ void VServer::clear() {
11991201
12001202 attrForSearch_.clear ();
12011203
1202- bool hasNotifications = server_->conf ()->notificationsEnabled ();
1204+ bool hasNotifications = false ;
1205+ if (auto * conf = server_->conf (); conf) {
1206+ hasNotifications = conf->notificationsEnabled ();
1207+ }
12031208
12041209 // Delete the children nodes. It will recursively delete all the nodes. It also saves the prevNodeState!!
12051210 for (auto it = children_.begin (); it != children_.end (); ++it) {
@@ -1383,7 +1388,10 @@ void VServer::endScan() {
13831388 return ;
13841389 }
13851390
1386- bool hasNotifications = server_->conf ()->notificationsEnabled ();
1391+ bool hasNotifications = false ;
1392+ if (auto * conf = server_->conf (); conf) {
1393+ hasNotifications = conf->notificationsEnabled ();
1394+ }
13871395
13881396 // Scan the suits.This will recursively scan all nodes in the tree.
13891397 for (const auto & suite : defs->suites ()) {
@@ -1471,15 +1479,15 @@ void VServer::beginUpdate(VNode* node, const std::vector<ecf::Aspect::Type>& asp
14711479 // update.
14721480
14731481 // Update the generated variables. There is no notification about their change so we have to do it!!!
1474- if (node->node ()) {
1482+ if (auto n = node->node (); n ) {
14751483 Suite* s = nullptr ;
1476- s = node-> node () ->isSuite ();
1484+ s = n ->isSuite ();
14771485 if (!s) {
1478- s = node-> node () ->suite ();
1486+ s = n ->suite ();
14791487 }
14801488
14811489 if (s && s->begun ()) {
1482- node-> node () ->update_generated_variables ();
1490+ n ->update_generated_variables ();
14831491 s->update_generated_variables ();
14841492 }
14851493
@@ -1726,8 +1734,12 @@ QString VServer::toolTip() {
17261734 }
17271735 }
17281736
1729- auto userLogHost = server_->conf ()->stringValue (VServerSettings::UserLogServerHost);
1730- auto userLogPort = server_->conf ()->stringValue (VServerSettings::UserLogServerPort);
1737+ QString userLogHost;
1738+ QString userLogPort;
1739+ if (auto * conf = server_->conf (); conf) {
1740+ userLogHost = conf->stringValue (VServerSettings::UserLogServerHost);
1741+ userLogPort = conf->stringValue (VServerSettings::UserLogServerPort);
1742+ }
17311743 if (!userLogHost.isEmpty () && !userLogPort.isEmpty ()) {
17321744 txt += " <br><b>Custom logserver</b>: " + userLogHost + " @" + userLogPort;
17331745 }
0 commit comments