提交 a8129894 编写于 作者: J Jose Luis Guardiola

Fixed #6563: Incorrect management for invalid files/filestorage/filenode in ml module

上级 c3d1f94e
......@@ -3036,6 +3036,7 @@ public:
{
FileStorage fs(filename, FileStorage::READ);
FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
if (fn.empty()) return Ptr<_Tp>();
Ptr<_Tp> obj = _Tp::create();
obj->read(fn);
return !obj->empty() ? obj : Ptr<_Tp>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册