You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ch...@apache.org on 2017/04/29 02:59:02 UTC

hbase git commit: HBASE-17879: Avoid NPE in snapshot.jsp when accessing without any request parameter

Repository: hbase
Updated Branches:
  refs/heads/master 6edb8f821 -> 1848353fd


HBASE-17879: Avoid NPE in snapshot.jsp when accessing without any request parameter

Signed-off-by: Chia-Ping Tsai <ch...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1848353f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1848353f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1848353f

Branch: refs/heads/master
Commit: 1848353fd60b2c51282552e9d0ad284be601cca5
Parents: 6edb8f8
Author: Abhishek Kumar <ab...@huawei.com>
Authored: Sat Apr 22 18:16:20 2017 +0530
Committer: Chia-Ping Tsai <ch...@gmail.com>
Committed: Sat Apr 29 10:51:46 2017 +0800

----------------------------------------------------------------------
 .../resources/hbase-webapps/master/snapshot.jsp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1848353f/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp b/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
index 75f75fc..ad3ede5 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
@@ -36,14 +36,16 @@
   SnapshotInfo.SnapshotStats stats = null;
   TableName snapshotTable = null;
   boolean tableExists = false;
-  try (Admin admin = master.getConnection().getAdmin()) {
-    for (SnapshotDescription snapshotDesc: admin.listSnapshots()) {
-      if (snapshotName.equals(snapshotDesc.getName())) {
-        snapshot = snapshotDesc;
-        stats = SnapshotInfo.getSnapshotStats(conf, snapshot);
-        snapshotTable = snapshot.getTableName();
-        tableExists = admin.tableExists(snapshotTable);
-        break;
+  if(snapshotName != null) {
+    try (Admin admin = master.getConnection().getAdmin()) {
+      for (SnapshotDescription snapshotDesc: admin.listSnapshots()) {
+        if (snapshotName.equals(snapshotDesc.getName())) {
+          snapshot = snapshotDesc;
+          stats = SnapshotInfo.getSnapshotStats(conf, snapshot);
+          snapshotTable = snapshot.getTableName();
+          tableExists = admin.tableExists(snapshotTable);
+          break;
+        }
       }
     }
   }
@@ -110,7 +112,7 @@
   <div class="container-fluid content">
   <div class="row inner_header">
     <div class="page-header">
-      <h1>Snapshot "<%= snapshotName %>" does not exists</h1>
+      <h1>Snapshot "<%= snapshotName %>" does not exist</h1>
     </div>
   </div>
   <p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect.