Skip to content

[KCModuleInfo] Don't access KPluginInfo unless it's valid

Ahmad Samir requested to merge work/ahmad/kplugininfo-service into master

systemsettings creates a KService for .desktop files with X-KDE-ServiceTypes=SystemSettingsExternalApp, in such cases there is no actual module, it just launches an external app, so IIUC there is no valid metadata and that is why constructing a KPluginInfo from that KService fails, stepping into the code with gdb confirms this.

It makes sense to not access the KPluginInfo private member of KCModuleInfo unless it is valid, so that service(), which is used by some users of the class to check whether the KCModuleInfo object is valid or not, doesn't cause a crash.

CCBUG: 421566

Merge request reports