Skip to content

Commit e4324c8

Browse files
committed
Access to atlas::Library::dataPath without initialising
1 parent 0e00ad9 commit e4324c8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/atlas/library/Library.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ std::string Library::cachePath() const {
173173
}
174174

175175
void Library::registerDataPath(const std::string& path) {
176-
ATLAS_DEBUG_VAR(path);
177176
if (data_paths_.empty()) {
178177
init_data_paths(data_paths_);
179178
}
@@ -183,7 +182,7 @@ void Library::registerDataPath(const std::string& path) {
183182

184183
std::string Library::dataPath() const {
185184
if (data_paths_.empty()) {
186-
ATLAS_THROW_EXCEPTION("Attempted to access atlas::Library function before atlas was initialized");
185+
init_data_paths(data_paths_);
187186
}
188187
std::vector<std::string> paths = data_paths_;
189188
auto join = [](const std::vector<std::string>& v, const std::string& sep) -> std::string {

src/atlas/library/Library.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Library : public eckit::system::Library {
104104

105105
private:
106106
std::vector<eckit::system::Plugin*> plugins_;
107-
std::vector<std::string> data_paths_;
107+
mutable std::vector<std::string> data_paths_;
108108
size_t atlas_io_trace_hook_;
109109
};
110110

0 commit comments

Comments
 (0)