Browse Source

[메인][Bug] 프로모션 팝업 데이터 정렬 시 오류 수정

hyodong.min 6 years ago
parent
commit
c746128391

+ 15 - 15
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainModel.java

@@ -182,19 +182,21 @@ public class MainModel extends CoinModel {
           if (null != popupInfoListBean) {
             promotionPopupBeans = popupInfoListBean.getPromotionPopupList();
 
-            Collections.sort(promotionPopupBeans, new Comparator<PromotionPopupBean>() {
-              @Override
-              public int compare(PromotionPopupBean promotionPopupBean, PromotionPopupBean t1) {
-                if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) < Integer.parseInt(t1.getOrderSeqNo())) {
-                  return -1;
+            if (null != promotionPopupBeans) {
+              Collections.sort(promotionPopupBeans, new Comparator<PromotionPopupBean>() {
+                @Override
+                public int compare(PromotionPopupBean promotionPopupBean, PromotionPopupBean t1) {
+                  if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) < Integer.parseInt(t1.getOrderSeqNo())) {
+                    return -1;
+                  }
+                  else if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) > Integer.parseInt(t1.getOrderSeqNo())) {
+                    return 1;
+                  }
+                  return 0;
                 }
-                else if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) > Integer.parseInt(t1.getOrderSeqNo())) {
-                  return 1;
-                }
-                return 0;
-              }
-            });
-            
+              });
+            }
+
             SystemPopupModelHelper.getInstance().setSystemPopupBeans(popupInfoListBean.getSystemPopupList());
           }
 
@@ -211,9 +213,7 @@ public class MainModel extends CoinModel {
         }
       });
     }
-    else
-
-    {
+    else {
       SystemPopupModelHelper.getInstance().setAvailableRefresh();
       promotionPopupBeans = SystemPopupModelHelper.getInstance().getPromotionPopupBeans();
       onResult(new Event.Builder(Event.SUCCESS).integer(Event.LOADED_POPUP_INFO).build());