浏览代码

Prevent crashing on the PulseAudioPlayingDetector

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Alexis Maiquez 3 年之前
父节点
当前提交
21bcb7008f
共有 1 个文件被更改,包括 1 次插入 和 1 次删除
  1. 1 1
      src/WallpaperEngine/Audio/Drivers/Detectors/CPulseAudioPlayingDetector.cpp

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/Detectors/CPulseAudioPlayingDetector.cpp

@@ -18,7 +18,7 @@ namespace WallpaperEngine::Audio::Drivers::Detectors
         // get processid
         const char* value = pa_proplist_gets (info->proplist, PA_PROP_APPLICATION_PROCESS_ID);
 
-        if (atoi (value) != getpid () && pa_cvolume_avg (&info->volume) != PA_VOLUME_MUTED)
+        if (value && atoi (value) != getpid () && pa_cvolume_avg (&info->volume) != PA_VOLUME_MUTED)
             detector->setIsPlaying (true);
     }