fixed NPE on log level changing when helthcheck isn't in use

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@400225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2006-05-06 02:12:13 +00:00
parent 2e492c27b1
commit 865e9ab8b2
1 changed files with 4 additions and 3 deletions

View File

@ -14,8 +14,6 @@
String enableActionStatus = ""; String enableActionStatus = "";
boolean isValid = false; boolean isValid = false;
File enableFile = new File(enabledFile);
if (action != null) { if (action != null) {
// Validate fname // Validate fname
if ("Enable".compareTo(action) == 0) isValid = true; if ("Enable".compareTo(action) == 0) isValid = true;
@ -28,6 +26,7 @@
if (isValid) { if (isValid) {
if ("Enable".compareTo(action) == 0) { if ("Enable".compareTo(action) == 0) {
try { try {
File enableFile = new File(enabledFile);
if (enableFile.createNewFile()) { if (enableFile.createNewFile()) {
enableActionStatus += "Enable Succeeded (enable file "; enableActionStatus += "Enable Succeeded (enable file ";
enableActionStatus += enabledFile; enableActionStatus += enabledFile;
@ -41,6 +40,7 @@
} }
if ("Disable".compareTo(action) == 0) { if ("Disable".compareTo(action) == 0) {
try { try {
File enableFile = new File(enabledFile);
if (enableFile.delete()) { if (enableFile.delete()) {
enableActionStatus = "Disable Succeeded (enable file "; enableActionStatus = "Disable Succeeded (enable file ";
enableActionStatus += enabledFile; enableActionStatus += enabledFile;
@ -70,7 +70,8 @@
} else { } else {
enableActionStatus = "Illegal Action"; enableActionStatus = "Illegal Action";
} }
// :TODO: might want to rework this so any logging change happens *after*
SolrCore.log.log(Level.INFO, enableActionStatus);
%> %>
<br clear="all"> <br clear="all">
<table> <table>