⚡ 优化,公众号菜单编辑增加健壮性判断

This commit is contained in:
lbw committed 2023-12-03 23:44:10 +08:00
1 parent 9bc3bd854b
commit adb149bd58
1 file changed
+2 -1
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author Binary Wang(https://github.com/binarywang)
@@ -57,7 +58,7 @@ public class MenuHandler extends AbstractHandler {
List<JSONObject> buttonList = new ArrayList<>();
for (JSONObject button : buttons) {
JSONArray subButton = button.getJSONArray("sub_button");
if (subButton.isEmpty()) {
if (Objects.isNull(subButton)) {
buttonList.add(button);
continue;
}