HBASE-23677 fix 500/NPE of region.jsp (#1033)

Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
This commit is contained in:
WenFeiYi 2020-01-15 19:32:27 +08:00 committed by Wellington Chevreuil
parent ceaeece2c5
commit a44f3b50e4
1 changed files with 7 additions and 2 deletions

View File

@ -32,8 +32,13 @@
HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
Region region = rs.getRegion(regionName);
String displayName = RegionInfoDisplay.getRegionNameAsStringForDisplay(region.getRegionInfo(),
rs.getConfiguration());
String displayName;
if (region != null) {
displayName = RegionInfoDisplay.getRegionNameAsStringForDisplay(region.getRegionInfo(),
rs.getConfiguration());
} else {
displayName = "region {" + regionName + "} is not currently online on this region server";
}
pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName());
%>
<jsp:include page="header.jsp">