We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d8814c0 + 60a13f3 commit 2a3db1cCopy full SHA for 2a3db1c
xml_converter/src/file_helper.cpp
@@ -187,7 +187,13 @@ unique_ptr<basic_istream<char>> _open_directory_file_for_read(
187
const string& filename
188
) {
189
unique_ptr<ifstream> input_filestream = make_unique<ifstream>();
190
- input_filestream->open(join_file_paths(base, filename), ios::in | ios::binary);
+
191
+ string filepath = join_file_paths(base, filename);
192
+ if (!filesystem::exists(filepath)) {
193
+ return nullptr;
194
+ }
195
196
+ input_filestream->open(filepath, ios::in | ios::binary);
197
198
unique_ptr<basic_istream<char>> basic_istream_stream(move(input_filestream));
199
0 commit comments