Skip to content
Snippets Groups Projects
Commit 1d586c7b authored by Fernando Pereira's avatar Fernando Pereira
Browse files

Avoid exception when getting the filename of un-init file

Just return the empty string
parent f2a6b1d2
No related merge requests found
......@@ -76,7 +76,7 @@ inline File::File(const std::string& filename, unsigned openFlags,
}
inline const std::string& File::getName() const noexcept {
if (_filename.empty()) {
if (_filename.empty() && isValid()) {
_filename = details::get_name([this](char* buffer, hsize_t length) {
return H5Fget_name(getId(), buffer, length);
});
......
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