Skip to content

Commit f8fd0de

Browse files
committed
prevent segfault when trying to initialize unknown bundle
1 parent c9a5da6 commit f8fd0de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Bundle.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SingleBundle SingleBundle::fromNameAndSearchPaths(
102102
}
103103

104104
std::stringstream ss;
105-
ss << "Could not determine path of bundle " << name << ". Looked " <<
105+
ss << "Could not determine path of bundle '" << name << "'. Looked " <<
106106
"into the following search paths: " << searchPathsString;
107107
throw(std::runtime_error(ss.str()));
108108
}
@@ -363,8 +363,13 @@ bool Bundle::initialize(bool loadTaskConfigs)
363363
}else
364364
{
365365
//ROCK_BUNDLE contains bundle name
366-
bundle = SingleBundle::fromNameAndSearchPaths(activeBundle,
367-
bundleSearchPaths());
366+
try{
367+
bundle = SingleBundle::fromNameAndSearchPaths(activeBundle,
368+
bundleSearchPaths());
369+
}catch(std::runtime_error& err){
370+
LOG_ERROR_S << err.what();
371+
return false;
372+
}
368373
}
369374
LOG_INFO_S << "Currently selected bundle: "<<bundle.name << " at " <<
370375
bundle.path;

0 commit comments

Comments
 (0)