mirror of https://github.com/apache/lucene.git
SOLR-4203: whoops - fix npe
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1423625 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bef4454e2f
commit
1389f64fbe
|
@ -85,7 +85,8 @@ public abstract class UpdateHandler implements SolrInfoMBean {
|
|||
|
||||
// not thread safe - for startup
|
||||
private void clearLog(PluginInfo ulogPluginInfo) {
|
||||
File tlogDir = UpdateLog.getTlogDir(ulogPluginInfo);
|
||||
if (ulogPluginInfo == null) return;
|
||||
File tlogDir = UpdateLog.getTlogDir(core, ulogPluginInfo);
|
||||
if (tlogDir.exists()) {
|
||||
String[] files = UpdateLog.getLogList(tlogDir);
|
||||
for (String file : files) {
|
||||
|
|
|
@ -1395,8 +1395,18 @@ public class UpdateLog implements PluginInfoInitialized {
|
|||
}
|
||||
}
|
||||
|
||||
public static File getTlogDir(PluginInfo info) {
|
||||
String dataDir = (String)info.initArgs.get("dir");
|
||||
public static File getTlogDir(SolrCore core, PluginInfo info) {
|
||||
String dataDir = (String) info.initArgs.get("dir");
|
||||
if (dataDir == null) {
|
||||
String ulogDir = core.getCoreDescriptor().getUlogDir();
|
||||
if (ulogDir != null) {
|
||||
dataDir = ulogDir;
|
||||
}
|
||||
|
||||
if (dataDir == null || dataDir.length() == 0) {
|
||||
dataDir = core.getDataDir();
|
||||
}
|
||||
}
|
||||
return new File(dataDir, TLOG_NAME);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue