From 3509edb43dafec81cdd95eb8e9bf837ecd2ab0f7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 2 Mar 2015 15:45:54 +0100 Subject: [PATCH] Always return a valid string on urid-unmap, special fix for Ingen Ingen is calling urid-unmap with URID 62465. There's no way that many URIs have been mapped, so something is weird in Ingen. Ingen aborts when it receives NULL on urid-unmap (caused by a bad URID), so as a workaround we'll return a valid but somewhat null URI. Ingen still needs fixing though. --- source/bridges-ui/CarlaBridgeUI-LV2.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/bridges-ui/CarlaBridgeUI-LV2.cpp b/source/bridges-ui/CarlaBridgeUI-LV2.cpp index 04424a8dc..6bd0f2e89 100644 --- a/source/bridges-ui/CarlaBridgeUI-LV2.cpp +++ b/source/bridges-ui/CarlaBridgeUI-LV2.cpp @@ -654,11 +654,12 @@ public: const char* getCustomURIDString(const LV2_URID urid) const noexcept { - CARLA_SAFE_ASSERT_RETURN(urid != CARLA_URI_MAP_ID_NULL, nullptr); - CARLA_SAFE_ASSERT_RETURN(urid < fCustomURIDs.count(), nullptr); + static const char* const sFallback = "urn:null"; + CARLA_SAFE_ASSERT_RETURN(urid != CARLA_URI_MAP_ID_NULL, sFallback); + CARLA_SAFE_ASSERT_RETURN(urid < fCustomURIDs.count(), sFallback); carla_debug("CarlaLv2Client::getCustomURIDString(%i)", urid); - return fCustomURIDs.getAt(urid, nullptr); + return fCustomURIDs.getAt(urid, sFallback); } // ---------------------------------------------------------------------