diff --git a/esphome/core/application.h b/esphome/core/application.h index 98c979b682..8e2035b7c5 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -257,7 +257,7 @@ class Application { /// Get the comment of this Application set by pre_setup(). std::string get_comment() const { return this->comment_; } /// Get the comment as StringRef (avoids allocation) - StringRef get_comment_ref() const { return StringRef::from_maybe_nullptr(this->comment_); } + StringRef get_comment_ref() const { return StringRef(this->comment_); } bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; }