From 5653e08dc6991ac5845dfd597dd7dc25546ead89 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 4 Dec 2023 12:10:50 +0100 Subject: [PATCH] fix: prevent self-link --- CMakeLists.txt | 2 +- package.json | 2 +- src/patchbay.impl.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8597bc8..53876c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.21) -project(venmic LANGUAGES CXX VERSION 2.1.3) +project(venmic LANGUAGES CXX VERSION 2.1.4) # -------------------------------------------------------------------------------------------------------- # Library options diff --git a/package.json b/package.json index b54eebc..91df3f6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "private": false, "license": "MIT", "author": "Curve (https://github.com/Curve)", - "version": "2.1.3", + "version": "2.1.4", "main": "./lib/index.js", "types": "./lib/module.d.ts", "scripts": { diff --git a/src/patchbay.impl.cpp b/src/patchbay.impl.cpp index 6156b4f..cda74eb 100644 --- a/src/patchbay.impl.cpp +++ b/src/patchbay.impl.cpp @@ -70,6 +70,12 @@ namespace vencord return; } + if (id == mic->id()) + { + logger::get()->warn("tried to link venmic to itself, this shouldn't happen!"); + return; + } + logger::get()->debug("trying to link {}, mic is {}", id, mic->id()); auto &target = nodes[id];