Browse Source

Added more checks to LayerViewProxy

Contributes to asana issue 49817948603866
Jaime van Kessel 9 years ago
parent
commit
d72ec68d8c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      plugins/LayerView/LayerViewProxy.py

+ 4 - 3
plugins/LayerView/LayerViewProxy.py

@@ -16,13 +16,14 @@ class LayerViewProxy(QObject):
     @pyqtProperty(bool, notify = activityChanged)
     def getLayerActivity(self):
         active_view = self._controller.getActiveView()
-        return active_view.getActivity()
+        if type(active_view) == LayerView.LayerView.LayerView:
+            return active_view.getActivity()
 
     @pyqtProperty(int, notify = maxLayersChanged)
     def numLayers(self):
         active_view = self._controller.getActiveView()
-        #print("num max layers " , active_view.getMaxLayers())
-        return active_view.getMaxLayers()
+        if type(active_view) == LayerView.LayerView.LayerView:
+            return active_view.getMaxLayers()
         #return 100
     
     @pyqtProperty(int, notify = currentLayerChanged)