From 3455dfc81987cda0eae239c0dc39f42474fdee45 Mon Sep 17 00:00:00 2001 From: alkonosst Date: Tue, 27 May 2025 12:15:02 -0400 Subject: [PATCH] fix: Allow task name to be accessed before task creation --- src/RTOScppTask.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/RTOScppTask.h b/src/RTOScppTask.h index ee1a483..d633e63 100644 --- a/src/RTOScppTask.h +++ b/src/RTOScppTask.h @@ -82,7 +82,7 @@ class ITask { /** * @brief Get the name of the task. - * @return const char* Task name, nullptr if the task is not created. + * @return const char* Task name. */ virtual const char* getName() const = 0; @@ -452,12 +452,9 @@ class Task : public ITask { /** * @brief Get the name of the task. - * @return const char* Task name, nullptr if the task is not created. + * @return const char* Task name. */ - const char* getName() const { - if (!isCreated()) return nullptr; - return _policy.getName(); - } + const char* getName() const { return _policy.getName(); } /** * @brief Get the parameters of the task.