diff --git a/beat/editor/widgets/toolchaineditor.py b/beat/editor/widgets/toolchaineditor.py index e5826b2bfdd5563bdf95f6464d0be4056e8b6790..2c190daa914e3e34ca412214ac65174f539b87b6 100644 --- a/beat/editor/widgets/toolchaineditor.py +++ b/beat/editor/widgets/toolchaineditor.py @@ -340,13 +340,25 @@ class Connection(QGraphicsPathItem): self.end_pin_name = connection_details["to"].split(".")[1] self.channel = connection_details["channel"] - hexadecimal = channel_colors[self.channel].lstrip("#") - hlen = len(hexadecimal) - self.connection_color = list( - int(hexadecimal[i : i + hlen // 3], 16) for i in range(0, hlen, hlen // 3) - ) - self.connection_color.append(255) - self.connection_pen.setColor(QColor(*self.connection_color)) + if self.channel is None or self.channel not in channel_colors: + warning = QMessageBox() + warning.setIcon(QMessageBox.Warning) + warning.setWindowTitle(toolchain.tr("Connection creation")) + warning.setInformativeText( + toolchain.tr("No dataset synchronization channel connection found!") + ) + warning.setStandardButtons(QMessageBox.Ok) + warning.exec_() + + else: + hexadecimal = channel_colors[self.channel].lstrip("#") + hlen = len(hexadecimal) + self.connection_color = list( + int(hexadecimal[i : i + hlen // 3], 16) + for i in range(0, hlen, hlen // 3) + ) + self.connection_color.append(255) + self.connection_pen.setColor(QColor(*self.connection_color)) self.blocks = toolchain.blocks