Commits

Aleš Erjavec  committed 5a69a29

Bug fix. Check for a None value.

  • Participants
  • Parent commits 179b46a

Comments (0)

Files changed (1)

File Orange/OrangeWidgets/Visualize/OWScatterPlot.py

 
         self.closeContext()
         sameDomain = self.data and data and data.domain.checksum() == self.data.domain.checksum() # preserve attribute choice if the domain is the same
-        if not hasattr(data, "name"):
+        if data is not None and not hasattr(data, "name"):
             data.name = "data"
         self.data = data
         self.vizrank.clearResults()
         if not self.data:
             return
         (selected, unselected) = self.graph.getSelectionsAsExampleTables([self.attrX, self.attrY])
-        if selected:
-            if not hasattr(selected, "name"):
-                selected.name = self.data.name + " (selected)"
-            if not hasattr(unselected, "name"):
-                selected.name = self.data.name + " (other)"
+
+        if selected is not None and not hasattr(selected, "name"):
+            selected.name = self.data.name + " (selected)"
+        if unselected is not None and not hasattr(unselected, "name"):
+            selected.name = self.data.name + " (other)"
+
         self.send("Selected Data", selected)
         self.send("Other Data", unselected)