Handle the lack of a pre-existing config file.

Originally committed to SVN as r4489.
This commit is contained in:
Amar Takhar 2010-06-13 01:29:32 +00:00
parent 0a590aea04
commit d8a9bac4b0

View file

@ -28,6 +28,7 @@
#include "libaegisub/cajun/elements.h"
#endif
#include "libaegisub/access.h"
#include "libaegisub/io.h"
#include "libaegisub/log.h"
@ -54,7 +55,15 @@ void Options::ConfigNext(std::istream& stream) {
}
void Options::ConfigUser() {
std::istream *stream = agi::io::Open(config_file);
std::istream *stream;
try {
stream = agi::io::Open(config_file);
} catch (const acs::AcsNotFound&) {
return;
}
/// @todo Handle other errors such as parsing and notifying the user.
LoadConfig(*stream);
config_loaded = true;
delete stream;