Skip to content

Commit 6558227

Browse files
committed
Propegate nullptr on Repository::GetPluginByPath
1 parent b4ccb82 commit 6558227

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pluginmanager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,10 @@ vector<Ref<Extension>> Repository::GetPlugins() const
352352

353353
Ref<Extension> Repository::GetPluginByPath(const string& pluginPath)
354354
{
355-
return new Extension(BNRepositoryGetPluginByPath(m_object, pluginPath.c_str()));
355+
BNPlugin* plugin = BNRepositoryGetPluginByPath(m_object, pluginPath.c_str());
356+
if (!plugin)
357+
return nullptr;
358+
return new Extension(plugin);
356359
}
357360

358361
string Repository::GetFullPath() const

0 commit comments

Comments
 (0)