Skip to content

Commit

Permalink
[query] fix NPE introduced in #12555 (#12711)
Browse files Browse the repository at this point in the history
Not all IOExceptions have a cause.
  • Loading branch information
danking authored Feb 17, 2023
1 parent dbfd553 commit 5f7e4be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hail/src/main/scala/is/hail/io/fs/GoogleStorageFS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class GoogleStorageFS(
makeUserProjectOption: String => U,
bucket: String
): T = exc match {
case exc: IOException =>
case exc: IOException if exc.getCause() != null =>
retryIfRequesterPays(exc.getCause(), makeRequest, makeUserProjectOption, bucket)
case exc: StorageException =>
retryIfRequesterPays(exc, exc.getMessage(), exc.getCode(), makeRequest, makeUserProjectOption, bucket)
Expand Down Expand Up @@ -332,7 +332,7 @@ class GoogleStorageFS(
}

def discoverExceptionThenRetryCopyIfRequesterPays(exc: Throwable): Unit = exc match {
case exc: IOException =>
case exc: IOException if exc.getCause() != null =>
discoverExceptionThenRetryCopyIfRequesterPays(exc.getCause())
case exc: StorageException =>
retryCopyIfRequesterPays(exc, exc.getMessage(), exc.getCode())
Expand Down

0 comments on commit 5f7e4be

Please sign in to comment.