Showing
3 changed files
with
7 additions
and
5 deletions
| ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true | ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true |
| 5 | 5 | ||
| 6 | ext { | 6 | ext { |
| 7 | PUBLISH_GROUP_ID = 'ly.warp' | 7 | PUBLISH_GROUP_ID = 'ly.warp' |
| 8 | - PUBLISH_VERSION = '4.5.5.4p8' | 8 | + PUBLISH_VERSION = '4.5.5.4p9' |
| 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 10 | } | 10 | } |
| 11 | 11 | ... | ... |
| ... | @@ -566,7 +566,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -566,7 +566,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
| 566 | 566 | ||
| 567 | String tempCoupon = ""; | 567 | String tempCoupon = ""; |
| 568 | int result = 0; | 568 | int result = 0; |
| 569 | - if (mCoupon.getCoupon().length() == 13) { | 569 | + if (mCoupon != null) { |
| 570 | + if (!TextUtils.isEmpty(mCoupon.getCoupon()) && mCoupon.getCoupon().length() == 13) { | ||
| 570 | tempCoupon = mCoupon.getCoupon(); | 571 | tempCoupon = mCoupon.getCoupon(); |
| 571 | 572 | ||
| 572 | try { | 573 | try { |
| ... | @@ -576,7 +577,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -576,7 +577,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
| 576 | } catch (Exception e) { | 577 | } catch (Exception e) { |
| 577 | e.printStackTrace(); | 578 | e.printStackTrace(); |
| 578 | } | 579 | } |
| 579 | - } else { | 580 | + } else if (!TextUtils.isEmpty(mCoupon.getCoupon()) && mCoupon.getCoupon().length() != 13) { |
| 580 | try { | 581 | try { |
| 581 | tempCoupon = mCoupon.getCoupon(); | 582 | tempCoupon = mCoupon.getCoupon(); |
| 582 | for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) { | 583 | for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) { |
| ... | @@ -596,6 +597,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -596,6 +597,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
| 596 | e.printStackTrace(); | 597 | e.printStackTrace(); |
| 597 | } | 598 | } |
| 598 | } | 599 | } |
| 600 | + } | ||
| 599 | 601 | ||
| 600 | createBarcodeBitmap(tempCoupon); | 602 | createBarcodeBitmap(tempCoupon); |
| 601 | } | 603 | } | ... | ... |
| ... | @@ -160,7 +160,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -160,7 +160,7 @@ public class Coupon implements Parcelable, Serializable { |
| 160 | if (json != null) { | 160 | if (json != null) { |
| 161 | this.barcode = json.optString(BARCODE); | 161 | this.barcode = json.optString(BARCODE); |
| 162 | this.category = json.optString(CATEGORY); | 162 | this.category = json.optString(CATEGORY); |
| 163 | - this.coupon = json.optString(COUPON); | 163 | + this.coupon = json.optString(COUPON, ""); |
| 164 | this.created = json.optString(CREATED); | 164 | this.created = json.optString(CREATED); |
| 165 | this.description = json.optString(DESCRIPTION); | 165 | this.description = json.optString(DESCRIPTION); |
| 166 | this.discount = json.optString(DISCOUNT); | 166 | this.discount = json.optString(DISCOUNT); |
| ... | @@ -214,7 +214,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -214,7 +214,7 @@ public class Coupon implements Parcelable, Serializable { |
| 214 | e.printStackTrace(); | 214 | e.printStackTrace(); |
| 215 | } | 215 | } |
| 216 | } | 216 | } |
| 217 | - this.coupon = json.optString(COUPON); | 217 | + this.coupon = json.optString(COUPON, ""); |
| 218 | this.couponsetUuid = json.optString(COUPONSET_UUID); | 218 | this.couponsetUuid = json.optString(COUPONSET_UUID); |
| 219 | this.discount = json.optString(DISCOUNT); | 219 | this.discount = json.optString(DISCOUNT); |
| 220 | if (this.discount.contains(",")) { | 220 | if (this.discount.contains(",")) { | ... | ... |
-
Please register or login to post a comment