修复表前缀为空时导致空指针异常问题

This commit is contained in:
makejava 2020-06-15 14:26:20 +08:00
parent 019b0067a3
commit eac2f33e43
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ public class CodeGenerateServiceImpl implements CodeGenerateService {
// 生成代码
for (TableInfo tableInfo : tableInfoList) {
// 表名去除前缀
if (tableInfo.getObj().getName().startsWith(tableInfo.getPreName())) {
if (!StringUtils.isEmpty(tableInfo.getPreName()) && tableInfo.getObj().getName().startsWith(tableInfo.getPreName())) {
String newName = tableInfo.getObj().getName().replace(tableInfo.getPreName(), "");
tableInfo.setName(NameUtils.getInstance().getClassName(newName));
}