mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
[fix][chat]Fix NPE problem.
This commit is contained in:
@@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class LLMSqlCorrector extends BaseSemanticCorrector {
|
||||
@@ -61,7 +62,8 @@ public class LLMSqlCorrector extends BaseSemanticCorrector {
|
||||
@Override
|
||||
public void doCorrect(ChatQueryContext chatQueryContext, SemanticParseInfo semanticParseInfo) {
|
||||
ChatApp chatApp = chatQueryContext.getChatAppConfig().get(APP_KEY);
|
||||
if (!chatQueryContext.getText2SQLType().enableLLM() || !chatApp.isEnable()) {
|
||||
if (!chatQueryContext.getText2SQLType().enableLLM() || Objects.isNull(chatApp)
|
||||
|| !chatApp.isEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user