Skip to content

Commit d224ee6

Browse files
committed
Fixed an issue where name_path could be initialized unexpectedly when app_info is not set during the connection process
1 parent 56a4ace commit d224ee6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/projects/base/info/stream.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ namespace info
147147

148148
void Stream::UpdateNamePath()
149149
{
150-
UpdateNamePath((_app_info != nullptr)
151-
? _app_info->GetVHostAppName()
152-
: info::VHostAppName::InvalidVHostAppName());
150+
if (_app_info != nullptr)
151+
{
152+
UpdateNamePath(_app_info->GetVHostAppName());
153+
}
153154
}
154155

155156
ov::String Stream::GetName() const

src/projects/base/info/stream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ namespace info
183183

184184
private:
185185
mutable std::mutex _name_path_mutex;
186-
NamePath _name_path;
186+
NamePath _name_path = NamePath::UnknownNamePath();
187187

188188
std::chrono::system_clock::time_point _created_time;
189189
std::chrono::system_clock::time_point _published_time;

0 commit comments

Comments
 (0)