diff --git a/rflib/main/default/classes/rflib_GlobalSettings.cls b/rflib/main/default/classes/rflib_GlobalSettings.cls index 181b42e9..22a94466 100644 --- a/rflib/main/default/classes/rflib_GlobalSettings.cls +++ b/rflib/main/default/classes/rflib_GlobalSettings.cls @@ -115,7 +115,7 @@ public with sharing class rflib_GlobalSettings { throw new rflib_InvalidArgumentException('newLimit', 'value provided (' + newLimit + ') is less than 0 or higher than allowed limit: ' + Limits.getPublishImmediateDML()); } - String newLimitStr = newLimit != null ? String.valueOf(newLimit) : rflib_Global_Setting__mdt.getInstance('Publish_Platform_Event_Transaction_Limit').Value__c; + String newLimitStr = newLimit != null ? String.valueOf(newLimit) : rflib_Global_Setting__mdt.getInstance('Publish_Platform_Event_Transaction_Limit')?.Value__c; SETTINGS.put('Publish_Platform_Event_Transaction_Limit', newLimitStr); } } \ No newline at end of file diff --git a/rflib/test/default/classes/rflib_GlobalSettingsTest.cls b/rflib/test/default/classes/rflib_GlobalSettingsTest.cls index 93a505cd..7ee2496a 100644 --- a/rflib/test/default/classes/rflib_GlobalSettingsTest.cls +++ b/rflib/test/default/classes/rflib_GlobalSettingsTest.cls @@ -41,7 +41,7 @@ private class rflib_GlobalSettingsTest { @IsTest static void testPublishingLimitOrDefault() { - Integer expectedValue = getConfiguredIntegerValueOrDefault('Publish_Platform_Event_Transaction_Limit', rflib_GlobalSettings.ARCHIVE_LOG_QUERY_LIMIT_DEFAULT_VALUE); + Integer expectedValue = getConfiguredIntegerValueOrDefault('Publish_Platform_Event_Transaction_Limit', rflib_GlobalSettings.PUBLISH_PLATFORM_EVENT_TRANSACTION_LIMIT_DEFAULT_VALUE); Test.startTest(); System.assertEquals(expectedValue, rflib_GlobalSettings.publishingLimitOrDefault);