Skip to content

Commit 9e7725c

Browse files
witgomateiz
authored andcommitted
SPARK-2662: Fix NPE for JsonProtocol
Author: GuoQiang Li <[email protected]> Closes apache#1511 from witgo/JsonProtocol and squashes the following commits: 2b6227f [GuoQiang Li] Fix NPE for JsonProtocol
1 parent 2d25e34 commit 9e7725c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/org/apache/spark/util/JsonProtocol.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ private[spark] object JsonProtocol {
257257
val reason = Utils.getFormattedClassName(taskEndReason)
258258
val json = taskEndReason match {
259259
case fetchFailed: FetchFailed =>
260-
val blockManagerAddress = blockManagerIdToJson(fetchFailed.bmAddress)
260+
val blockManagerAddress = Option(fetchFailed.bmAddress).
261+
map(blockManagerIdToJson).getOrElse(JNothing)
261262
("Block Manager Address" -> blockManagerAddress) ~
262263
("Shuffle ID" -> fetchFailed.shuffleId) ~
263264
("Map ID" -> fetchFailed.mapId) ~

0 commit comments

Comments
 (0)