Skip to content

ConnectionBackenp: fix passing errorString

Méven Car requested to merge work/meven/fix-compile-warn into master

Fix a compile warning and potential crash in error path.

this was introduced by e1182af2

/home/meven/kde/src/kio/src/core/connectionbackend.cpp: In member function ‘KIO::ConnectionBackend::ConnectionResult KIO::ConnectionBackend::listenForRemote()’:
/home/meven/kde/src/kio/src/core/connectionbackend.cpp:122:50: warning: ‘this’ pointer is null [-Wnonnull]
  122 |         return {false, localServer->errorString()};
      |                                                  ^
In file included from /home/meven/kde/qt/include/QtNetwork/QLocalServer:1,
                 from /home/meven/kde/src/kio/src/core/connectionbackend.cpp:16:
/home/meven/kde/qt/include/QtNetwork/qlocalserver.h:46:13: note: in a call to non-static member function ‘QString QLocalServer::errorString() const’
   46 |     QString errorString() const;
      |             ^~~~~~~~~~~

cc @nicolasfella

Edited by Méven Car

Merge request reports

Loading