Commit c1e96bfe authored by Menethil's avatar Menethil
Browse files

修复空值错误

parent b4d2d076
package org.linlinjava.litemall.wx.service;
package org.linlinjava.litemall.core.system;
import org.linlinjava.litemall.core.system.SystemInfoPrinter;
import org.linlinjava.litemall.core.util.SystemInfoPrinter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 系统启动服务,用于检查系统状态及打印系统信息
*/
@Component
public class SystemInistService {
class SystemInistService {
private SystemInistService systemInistService;
@Autowired
private Environment environment;
@PostConstruct
public void inist() {
private void inist() {
systemInistService = this;
SystemInfoPrinter.printInfo("WX-API 初始化信息", getSystemInfo());
SystemInfoPrinter.printInfo("Litemall 初始化信息", getSystemInfo());
}
private Map<String, String> getSystemInfo() {
......
package org.linlinjava.litemall.core.system;
package org.linlinjava.litemall.core.util;
import java.util.Map;
......@@ -21,6 +21,9 @@ public class SystemInfoPrinter {
private static void setMaxSize(Map<String, String> infos) {
for (Map.Entry<String, String> entry : infos.entrySet()) {
if (entry.getValue() == null)
continue;
int size = entry.getKey().length() + entry.getValue().length();
if (size > maxSize)
......@@ -52,6 +55,9 @@ public class SystemInfoPrinter {
}
private static void printLine(String head, String line) {
if (line == null)
return;
if (head.startsWith(CREATE_PART_COPPER)) {
System.out.println("");
System.out.println(" [[ " + line + " ]]");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment