Commit c393a7a9 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #6564 from jlguardi:ml_load_empty_ptr

parents 5c54360f a8129894
......@@ -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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment