Skip to content

Commit de06128

Browse files
committed
Fix the bug that entering only 1 arg will cause array out of bounds exception.
1 parent e838a25 commit de06128

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object SparkPageRank {
5151
showWarning()
5252

5353
val sparkConf = new SparkConf().setAppName("PageRank")
54-
val iters = if (args.length > 0) args(1).toInt else 10
54+
val iters = if (args.length > 1) args(1).toInt else 10
5555
val ctx = new SparkContext(sparkConf)
5656
val lines = ctx.textFile(args(0), 1)
5757
val links = lines.map{ s =>

0 commit comments

Comments
 (0)