# Buggy code
def _initialize(self):
    matrix_existed = self.effective_matrix is not None
    effective_matrix = self.effective_matrix
    self.__invalidated = True
    self.data = None
    self.effective_matrix = None
    self.closeContext()
    self.clear_messages()

    # if no data nor matrix is present reset plot
    if self.signal_data is None and self.matrix is None:
        self.clear()
        self.init_attr_values()
        return

    if (
        self.signal_data is not None
        and self.matrix is not None
        and len(self.signal_data) != len(self.matrix)
    ):
        self.Error.mismatching_dimensions()
        self.clear()
        self.init_attr_values()
        return

    if self.signal_data is not None:
        self.data = self.signal_data
    elif self.matrix_data is not None:
        self.data = self.matrix_data

    if self.matrix is not None:
        self.effective_matrix = self.matrix
        if self.matrix.axis == 0 and self.data is self.matrix_data:
            self.data = None
    elif self.data.domain.attributes:
        preprocessed_data = MDS().preprocess(self.data)
        self.effective_matrix = Euclidean(preprocessed_data)
    else:
        self.Error.no_attributes()
        self.clear()
        self.init_attr_values()
        return

    self.init_attr_values()
    self.openContext(self.data)
    self.__invalidated = not (
        matrix_existed
        and self.effective_matrix is not None
        and np.array_equal(effective_matrix, self.effective_matrix)
    )
    if self.__invalidated:
        self.clear()
    self.graph.set_effective_matrix(self.effective_matrix)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/home/lan/dev/orange3/Orange/widgets/visualize/utils/plotutils.py", line 124, in eventFilter
return self.delegate(event)
File "/home/lan/dev/orange3/Orange/widgets/visualize/owscatterplotgraph.py", line 1302, in help_event
text = self.master.get_tooltip(point_data)
File "/home/lan/dev/orange3/Orange/widgets/visualize/utils/widget.py", line 330, in get_tooltip
for point_id in point_ids[:MAX_POINTS_IN_TOOLTIP])
File "/home/lan/dev/orange3/Orange/widgets/visualize/utils/widget.py", line 330, in <genexpr>
for point_id in point_ids[:MAX_POINTS_IN_TOOLTIP])
File "/home/lan/dev/orange3/Orange/widgets/visualize/utils/widget.py", line 306, in _point_tooltip
domain = self.data.domain
AttributeError: 'NoneType' object has no attribute 'domain'

# Fixed code
def _initialize(self):
    matrix_existed = self.effective_matrix is not None
    effective_matrix = self.effective_matrix
    self.__invalidated = True
    self.data = None
    self.effective_matrix = None
    self.closeContext()
    self.clear_messages()

    # if no data nor matrix is present reset plot
    if self.signal_data is None and self.matrix is None:
        self.clear()
        self.init_attr_values()
        return

    if (
        self.signal_data is not None
        and self.matrix is not None
        and len(self.signal_data) != len(self.matrix)
    ):
        self.Error.mismatching_dimensions()
        self.clear()
        self.init_attr_values()
        return

    if self.signal_data is not None:
        self.data = self.signal_data
    elif self.matrix_data is not None:
        self.data = self.matrix_data

    if self.matrix is not None:
        self.effective_matrix = self.matrix
        if (
            self.matrix.axis == 0
            and self.data is not None
            and self.data is self.matrix_data
        ):
            names = [[attr.name] for attr in self.data.domain.attributes]
            domain = Domain([], metas=[StringVariable("labels")])
            self.data = Table(domain, names)
    elif self.data.domain.attributes:
        preprocessed_data = MDS().preprocess(self.data)
        self.effective_matrix = Euclidean(preprocessed_data)
    else:
        self.Error.no_attributes()
        self.clear()
        self.init_attr_values()
        return

    self.init_attr_values()
    self.openContext(self.data)
    self.__invalidated = not (
        matrix_existed
        and self.effective_matrix is not None
        and np.array_equal(effective_matrix, self.effective_matrix)
    )
    if self.__invalidated:
        self.clear()
    self.graph.set_effective_matrix(self.effective_matrix)