aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/stream.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index a7cdc2d9..ce948109 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -472,6 +472,9 @@ int is_stream(const char *filename) {
char line[1024];
char *rval = NULL;
fh = fopen(filename, "r");
+ if ( fh == NULL ) {
+ return -1;
+ }
rval = fgets(line, 1023, fh);
fclose(fh);
if ( rval == NULL ) {
@@ -483,5 +486,4 @@ int is_stream(const char *filename) {
else {
return 0;
}
- return -1;
}