Skip to content

Commit fb93fa7

Browse files
authored
fix NPE when reload (#2208)
1 parent fcdf7e7 commit fb93fa7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/com/actiontech/dble/config/ServerConfig.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Copyright (C) 2016-2020 ActionTech.
3-
* based on code by MyCATCopyrightHolder Copyright (c) 2013, OpenCloudDB/MyCAT.
4-
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher.
5-
*/
2+
* Copyright (C) 2016-2020 ActionTech.
3+
* based on code by MyCATCopyrightHolder Copyright (c) 2013, OpenCloudDB/MyCAT.
4+
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher.
5+
*/
66
package com.actiontech.dble.config;
77

88
import com.actiontech.dble.DbleServer;
@@ -15,6 +15,7 @@
1515
import com.actiontech.dble.config.model.*;
1616
import com.actiontech.dble.config.util.ConfigException;
1717
import com.actiontech.dble.config.util.ConfigUtil;
18+
import com.actiontech.dble.meta.SchemaMeta;
1819
import com.actiontech.dble.route.parser.ManagerParseConfig;
1920
import com.actiontech.dble.route.parser.util.Pair;
2021
import com.actiontech.dble.server.variables.SystemVariables;
@@ -433,7 +434,10 @@ private boolean reloadMetaData(List<Pair<String, String>> delTables, List<Pair<S
433434
LOGGER.debug("metadata will delete Tables:" + tables);
434435
}
435436
for (Pair<String, String> table : delTables) {
436-
ProxyMeta.getInstance().getTmManager().getCatalogs().get(table.getKey()).dropTable(table.getValue());
437+
SchemaMeta oldSchemaMeta = ProxyMeta.getInstance().getTmManager().getCatalogs().get(table.getKey());
438+
if (oldSchemaMeta != null) {
439+
oldSchemaMeta.dropTable(table.getValue());
440+
}
437441
}
438442
LOGGER.info("metadata finished for deleted tables");
439443
}

0 commit comments

Comments
 (0)