mirror of
https://github.com/oatpp/oatpp.git
synced 2025-01-30 16:59:30 +08:00
fix crashed (#186)
multipart::createAsyncFilePartReader("/path/to/file"); When the path "/path/to/file" is not exist. it will crashed.
This commit is contained in:
parent
c431270220
commit
70430b0097
@ -48,7 +48,7 @@ FileInputStream::FileInputStream(const char* filename)
|
||||
}
|
||||
|
||||
FileInputStream::~FileInputStream() {
|
||||
if(m_ownsFile) {
|
||||
if(m_ownsFile && m_file) {
|
||||
std::fclose(m_file);
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ FileOutputStream::FileOutputStream(const char* filename, const char* mode)
|
||||
}
|
||||
|
||||
FileOutputStream::~FileOutputStream() {
|
||||
if(m_ownsFile) {
|
||||
if(m_ownsFile && m_file) {
|
||||
std::fclose(m_file);
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ Caret::StateSaveGuard::StateSaveGuard(Caret& caret)
|
||||
, m_savedErrorCode(caret.m_errorCode)
|
||||
{}
|
||||
|
||||
Caret::StateSaveGuard::~StateSaveGuard() {
|
||||
Caret::StateSaveGuard::~StateSaveGuard() {
|
||||
m_caret.m_pos = m_savedPosition;
|
||||
m_caret.m_errorMessage = m_savedErrorMessage;
|
||||
m_caret.m_errorCode = m_savedErrorCode;
|
||||
|
Loading…
Reference in New Issue
Block a user