diff --git a/apps/app_test.c b/apps/app_test.c
index 90af93c7791e2a88a845b18c3d512cfff25ca50b..3743b677135da88668d7ab196cdd809b95b6bddf 100755
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -88,6 +88,10 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who)
 	}
 	if (res < 0)
 		return res;
+	if (!samples) {
+		ast_log(LOG_NOTICE, "No samples were received from the other side!\n");
+		return -1;
+	}
 	ast_log(LOG_DEBUG, "%s: Noise: %d, samples: %d, avg: %d\n", who, noise, samples, noise / samples);
 	return (noise / samples);
 }