Author: bklaas
Date: Mon Jan 17 13:27:57 2011
New Revision: 9287

URL: http://svn.slimdevices.com/jive?rev=9287&view=rev
Log:
Fixed Bug: 14437
Description: test for self.slimproto before executing methods on that object

Modified:
    7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua?rev=9287&r1=9286&r2=9287&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua 
(original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua Mon 
Jan 17 13:27:57 2011
@@ -174,6 +174,10 @@
 
 
 function needsMusicSource(self)
+       if not self.slimproto then
+               log:warn("no slimproto connection")
+               return true
+       end
        return not self.slimproto:isConnected()
 end
 
@@ -195,7 +199,7 @@
 
        -- Needs to be fully connected, both SlimProto and Comet connection 
before we can use server connection
        -- Otherwise, just do it locally
-       if not self:isConnected() then
+       if not self:isConnected() and self.slimproto then
                log:info('connectToServer(): connecting localPlayer to server', 
server, ' via internal call')
 
                -- close any previous connection
@@ -215,12 +219,20 @@
 end
 
 function connectIp(self, serverip, slimserverip)
+       if not self.slimproto then
+               log:warn("no slimproto connection")
+               return
+       end
        self.slimproto:disconnect()
        self.slimproto:connectIp(serverip, slimserverip)
 end
 
 
 function disconnectFromServer(self)
+       if not self.slimproto then
+               log:warn("no slimproto connection")
+               return
+       end
        self.slimproto:disconnect()
        self.playback:stop()
 end
@@ -244,14 +256,21 @@
 -- can be used to tell the player to switch servers.
 
 function isConnected(self)
+       if not self.slimproto then
+               log:warn('no slimproto connection')
+               return false
+       end
        return self.slimproto:isConnected() and Player.isConnected(self)
 end
+
 
 -- Has the connection attempt actually failed
 function hasConnectionFailed(self)
+       if not self.slimproto then
+               return true
+       end
        return self.slimproto:hasConnectionFailed()
 end
-
 
 
 function setSignalStrength(self, signalStrength)

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to