aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-07-27 04:29:53 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-07-27 09:05:20 +0200
commitb1ae955caf91b2f64e8d5be7242166864ae1cb64 (patch)
tree71e9d512a4cd7a5cd484bfd9db251f34cb4e059a /src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java
parent1cbba986dbb39051df583be0f1e852ebe84bf583 (diff)
Fix NPE when passing null Location to XMLStreamException.
PiperOrigin-RevId: 163291269
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java')
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java b/src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java
index 177eaf64a7..4cbb1b13f9 100644
--- a/src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java
+++ b/src/tools/android/java/com/google/devtools/build/android/DataValueFileWithIds.java
@@ -70,7 +70,12 @@ public class DataValueFileWithIds {
}
eventReader.close();
} catch (XMLStreamException e) {
- throw new XMLStreamException(source + ": " + e.getMessage(), e.getLocation(), e);
+ if (e.getLocation() != null) {
+ throw new XMLStreamException(source + ": " + e.getMessage(), e.getLocation(), e);
+ } else {
+ throw new XMLStreamException(source + ": " + e.getMessage(), e);
+ }
+
} catch (RuntimeException e) {
throw new RuntimeException("Error parsing " + source, e);
}