Fix error handling if FindExport fails

This commit is contained in:
Maschell 2024-04-26 13:48:20 +02:00
parent 38e02d706a
commit 71e6149b30

View File

@ -105,27 +105,27 @@ NotificationModuleStatus NotificationModule_InitLibrary() {
}
if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "NMAddDynamicNotification", (void **) &sNMAddDynamicNotification) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE_ERR("FindExport NMAddDynamicNotification failed.");
sNMAddStaticNotification = nullptr;
sNMAddDynamicNotification = nullptr;
}
if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "NMUpdateDynamicNotificationText", (void **) &sNMUpdateDynamicNotificationText) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE_ERR("FindExport NMUpdateDynamicNotificationText failed.");
sNMAddStaticNotification = nullptr;
sNMUpdateDynamicNotificationText = nullptr;
}
if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "NMUpdateDynamicNotificationBackgroundColor", (void **) &sNMUpdateDynamicNotificationBackgroundColor) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE_ERR("FindExport NMUpdateDynamicNotificationBackgroundColor failed.");
sNMAddStaticNotification = nullptr;
sNMUpdateDynamicNotificationBackgroundColor = nullptr;
}
if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "NMUpdateDynamicNotificationTextColor", (void **) &sNMUpdateDynamicNotificationTextColor) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE_ERR("FindExport NMUpdateDynamicNotificationTextColor failed.");
sNMAddStaticNotification = nullptr;
sNMUpdateDynamicNotificationTextColor = nullptr;
}
if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "NMFinishDynamicNotification", (void **) &sNMFinishDynamicNotification) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE_ERR("FindExport NMFinishDynamicNotification failed.");
sNMAddStaticNotification = nullptr;
sNMFinishDynamicNotification = nullptr;
}
sDefaultValues.clear();