Check File Handle in TextScanWorkOrder to avoid segfault.
diff --git a/relational_operators/TextScanOperator.cpp b/relational_operators/TextScanOperator.cpp
index 66137d8..9e3bcb1 100644
--- a/relational_operators/TextScanOperator.cpp
+++ b/relational_operators/TextScanOperator.cpp
@@ -273,6 +273,11 @@
// Read text segment into buffer.
file = std::fopen(filename_.c_str(), "rb");
+ if (file == nullptr) {
+ LOG(ERROR) << "Failed to open file " << filename_
+ << " with error: " << strerror(errno);
+ return;
+ }
std::fseek(file, text_offset_, SEEK_SET);
bytes_read = std::fread(buffer, 1, text_segment_size_, file);