[banshee] AudioCdService: Throw an exception if no HardwareManager is available



commit 7cbb78f024f5d6ca2ba3c0b5aeec27da91747930
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Thu Aug 18 23:40:51 2011 +0200

    AudioCdService: Throw an exception if no HardwareManager is available
    
    This avoid a cryptic NRE later on when HardwareManager is null.
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../Banshee.AudioCd/AudioCdService.cs              |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdService.cs b/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdService.cs
index af27237..10bbbc4 100644
--- a/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdService.cs
+++ b/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdService.cs
@@ -54,6 +54,10 @@ namespace Banshee.AudioCd
 
         public void Initialize ()
         {
+            if (ServiceManager.HardwareManager == null) {
+                throw new NotSupportedException ("AudioCdService cannot work when no HardwareManager is available");
+            }
+
             lock (this) {
                 InstallPreferences ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]