PHOENIX-4287 Add null check for parent name
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 18f28e2..eb09813 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -1246,9 +1246,10 @@
}
/*
* For a view index, we use the property set on view. For indexes on base table, whether
- * global or local, we use the property set on the base table.
+ * global or local, we use the property set on the base table. Null check needed when
+ * dropping local indexes.
*/
- if (table.getType() == PTableType.INDEX) {
+ if (table.getType() == PTableType.INDEX && table.getParentName() != null) {
PhoenixConnection conn = context.getConnection();
String parentTableName = table.getParentName().getString();
try {