summaryrefslogtreecommitdiff
path: root/main/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/file.c')
-rw-r--r--main/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c
index 016afd197..cb495b310 100644
--- a/main/file.c
+++ b/main/file.c
@@ -1020,6 +1020,9 @@ int ast_closestream(struct ast_filestream *f)
* We close the stream in order to quit queuing frames now, because we might
* change the writeformat, which could result in a subsequent write error, if
* the format is different. */
+ if (f == NULL) {
+ return 0;
+ }
filestream_close(f);
ao2_ref(f, -1);
return 0;