mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
#12654 Las import: fix crash for files with CR/LF on linux
The file in question had a "empty" line with CR/LF line ending at the end of the file. When reading this on linux (using getline) you get a non-empty string containing the CR token. For these cases GetRecord returns true with a empty record vector, and this expected in the calling code. Crash happens when accessing the first (non-existing) element of the empty vector when trying to provide error message. Fixed by having GetRecord return false when vector is empty. Fixes #12654.
This commit is contained in:
1 parent
ade8e1d7e6
commit
545d827774
1 file changed
+1
-1
+1
-1
@@ -439,7 +439,7 @@ LasWell::GetRecord(std:: ifstream & fin,
|
||||
record.insert(record.end(), items.begin(), items.end());
|
||||
}
|
||||
}
|
||||
return(true);
|
||||
return(!record.empty());
|
||||
}
|
||||
|
||||
void LasWell::AddLog(const std::string & name,
|
||||
|
||||
Reference in new issue
Block a user