[banshee] u1ms: Do a null check to prevent NRE



commit 906735bb5b80c0456f014d189a6914ff6fe3fe57
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Wed Oct 19 13:08:03 2011 +0100

    u1ms: Do a null check to prevent NRE
    
    This easy null check may prevent critical bgo#660818
    from happening. Rather than waiting for feedback
    on BGO, I'm pushing this harmless change as it may
    eventually be faster to know if this works thanks
    to the daily PPA, and then we can backport it to
    the stable branch later.

 .../UbuntuOneMusicStoreSource.cs                   |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
index b2703a1..d8e8656 100644
--- a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
+++ b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
@@ -85,6 +85,11 @@ namespace Banshee.UbuntuOneMusicStore
 
         private void OnDefaultStoreUrlLoaded (object o, UbuntuOne.UrlLoadedArgs args)
         {
+            if (args == null || args.Url == null) {
+                //may happen when there is no internet connection
+                return;
+            }
+
             if (args.Url.StartsWith( "http://stores.7digital.com/default";)) {
                 // we just do this the first time we load the default store view
                 // so that we can switch to the passed u1ms uri and not have it switch out on us.



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