From 95dff547d2384aaeeae110079fd68ff3a0516107 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Thu, 28 Dec 2017 17:23:09 +0800 Subject: [PATCH] fix --- .../manage/appclient/core/impls/RetailAppServiceImp.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 95bc0f3ae..d12236795 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1175,8 +1175,12 @@ public class RetailAppServiceImp implements RetailAppService { deviceSupport.findRegister(clientType); JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); JSONArray acts = res.getJSONArray("data"); - int selectNo = RandomUtils.nextInt(0,acts.size()); - return acts.getJSONObject(selectNo); + if (acts.size()>0){ + int selectNo = RandomUtils.nextInt(0,acts.size()); + return acts.getJSONObject(selectNo); + } + return null; + } private static boolean mathchLetterorNum(String str) {