Browse Source

prevent crash in getSpeeds() if currentControls is None

Darren Ranalli 18 years ago
parent
commit
41457534fe
1 changed files with 3 additions and 1 deletions
  1. 3 1
      direct/src/controls/ControlManager.py

+ 3 - 1
direct/src/controls/ControlManager.py

@@ -158,7 +158,9 @@ class ControlManager:
         #self.monitorTask.remove()
         #self.monitorTask.remove()
 
 
     def getSpeeds(self):
     def getSpeeds(self):
-        return self.currentControls.getSpeeds()
+        if self.currentControls:
+            return self.currentControls.getSpeeds()
+        return None
 
 
     def getIsAirborne(self):
     def getIsAirborne(self):
         if self.currentControls:
         if self.currentControls: