⚡ 优化,公众号菜单编辑增加健壮性判断
This commit is contained in:
1 parent
5db1ca8e62
commit
247c5dbcc9
1 file changed
+2
-1
+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)
|
||||
@@ -58,7 +59,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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user