Skip to content

Commit

Permalink
fix 500/NPE of region.jsp (#1033)
Browse files Browse the repository at this point in the history
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
  • Loading branch information
WenFeiYi authored and wchevreuil committed Jan 15, 2020
1 parent c1ba3bf commit d60ce17
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit d60ce17

Please sign in to comment.