Skip to content

Commit

Permalink
SPARK-2662: Fix NPE for JsonProtocol
Browse files Browse the repository at this point in the history
Author: GuoQiang Li <[email protected]>

Closes apache#1511 from witgo/JsonProtocol and squashes the following commits:

2b6227f [GuoQiang Li] Fix NPE for JsonProtocol
  • Loading branch information
witgo authored and mateiz committed Jul 24, 2014
1 parent 2d25e34 commit 9e7725c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/util/JsonProtocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ private[spark] object JsonProtocol {
val reason = Utils.getFormattedClassName(taskEndReason)
val json = taskEndReason match {
case fetchFailed: FetchFailed =>
val blockManagerAddress = blockManagerIdToJson(fetchFailed.bmAddress)
val blockManagerAddress = Option(fetchFailed.bmAddress).
map(blockManagerIdToJson).getOrElse(JNothing)
("Block Manager Address" -> blockManagerAddress) ~
("Shuffle ID" -> fetchFailed.shuffleId) ~
("Map ID" -> fetchFailed.mapId) ~
Expand Down

0 comments on commit 9e7725c

Please sign in to comment.