This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit e10346ba53088f52575da4d01c0d04d033a03a68 Author: qiye <jianliang5...@gmail.com> AuthorDate: Thu Jan 19 15:13:21 2023 +0800 [fix](multi-catalog)switching catalogs after dropping will get NPE. (#16067) Issue Number: close #16066 --- fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java index 3194f5c350..2cfd39f70a 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java @@ -4447,7 +4447,10 @@ public class Env { String currentDB = ctx.getDatabase(); if (StringUtils.isNotEmpty(currentDB)) { - catalogMgr.addLastDBOfCatalog(ctx.getCurrentCatalog().getName(), currentDB); + // When dropped the current catalog in current context, the current catalog will be null. + if (ctx.getCurrentCatalog() != null) { + catalogMgr.addLastDBOfCatalog(ctx.getCurrentCatalog().getName(), currentDB); + } } ctx.changeDefaultCatalog(catalogName); String lastDb = catalogMgr.getLastDB(catalogName); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org