diff --git a/main/app.c b/main/app.c
index b70ef022ff02aed29bd3d13214683c44091c01b3..99eaec3f63f77fac0a9f6cd2a2b49bd134cf14b2 100644
--- a/main/app.c
+++ b/main/app.c
@@ -760,7 +760,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
 	 * message, otherwise we could get a situation where this stream is never
 	 * closed (which would create a resource leak).
 	 */
-	*duration = ast_tellstream(others[0]) / 8000;
+	*duration = others[0] ? ast_tellstream(others[0]) / 8000 : 0;
 
 	if (!prepend) {
 		for (x = 0; x < fmtcnt; x++) {