[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kmix] gui: Fix a potential NPE on an unknown action for the KF5 build.
From:       Christian Esken <esken () kde ! org>
Date:       2015-01-20 19:41:12
Message-ID: E1YDefo-0001ss-Ed () scm ! kde ! org
[Download RAW message or body]

Git commit bd031f051c5214b2f9ea8570355957a4fd392a6a by Christian Esken.
Committed on 20/01/2015 at 19:33.
Pushed by esken into branch 'master'.

Fix a potential NPE on an unknown action for the KF5 build.

REVIEW: 120432

M  +13   -1    gui/kmixdockwidget.cpp

http://commits.kde.org/kmix/bd031f051c5214b2f9ea8570355957a4fd392a6a

diff --git a/gui/kmixdockwidget.cpp b/gui/kmixdockwidget.cpp
index eeccb36..d72f42c 100644
--- a/gui/kmixdockwidget.cpp
+++ b/gui/kmixdockwidget.cpp
@@ -106,7 +106,19 @@ void KMixDockWidget::controlsChange(int changeType)
 //      _kmixMainWindow->updateDocking();
 //      _kmixMainWindow->saveConfig();
       refreshVolumeLevels();
-      findAction("select_master")->setEnabled(Mixer::getGlobalMasterMixer() != 0);
+      {
+		  QAction *selectMasterAction = findAction("select_master");
+		  if(selectMasterAction)
+		  {
+			  // Review #120432 : Guard findAction("select_master"), as it is sometimes 0 on the KF5 build
+			  //                  This is probably not a final solution, but better than a crash.
+			  selectMasterAction->setEnabled(Mixer::getGlobalMasterMixer() != 0);
+		  }
+		  else
+		  {
+			  kWarning() << "select_master action not found. Cannot enable it in the Systray.";
+		  }
+      }
       break;
 
     case ControlChangeType::Volume:
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic