Index: src/library/stats/R/fligner.test.R
===================================================================
--- src/library/stats/R/fligner.test.R	(revision 76710)
+++ src/library/stats/R/fligner.test.R	(working copy)
@@ -55,6 +55,8 @@
 
     ## Careful. This assumes that g is a factor:
     x <- x - tapply(x,g,median)[g]
+    if (all(x == 0))
+      stop("data are essentially constant")
 
     a <- qnorm((1 + rank(abs(x)) / (n + 1)) / 2)
     STATISTIC <- sum(tapply(a, g, "sum")^2 / tapply(a, g, "length"))
