Panagiotis Triantafyllou

new version, minor fix

......@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4p8'
PUBLISH_VERSION = '4.5.5.4p9'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -566,7 +566,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
String tempCoupon = "";
int result = 0;
if (mCoupon.getCoupon().length() == 13) {
if (mCoupon != null) {
if (!TextUtils.isEmpty(mCoupon.getCoupon()) && mCoupon.getCoupon().length() == 13) {
tempCoupon = mCoupon.getCoupon();
try {
......@@ -576,7 +577,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
} catch (Exception e) {
e.printStackTrace();
}
} else {
} else if (!TextUtils.isEmpty(mCoupon.getCoupon()) && mCoupon.getCoupon().length() != 13) {
try {
tempCoupon = mCoupon.getCoupon();
for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) {
......@@ -596,6 +597,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
e.printStackTrace();
}
}
}
createBarcodeBitmap(tempCoupon);
}
......
......@@ -160,7 +160,7 @@ public class Coupon implements Parcelable, Serializable {
if (json != null) {
this.barcode = json.optString(BARCODE);
this.category = json.optString(CATEGORY);
this.coupon = json.optString(COUPON);
this.coupon = json.optString(COUPON, "");
this.created = json.optString(CREATED);
this.description = json.optString(DESCRIPTION);
this.discount = json.optString(DISCOUNT);
......@@ -214,7 +214,7 @@ public class Coupon implements Parcelable, Serializable {
e.printStackTrace();
}
}
this.coupon = json.optString(COUPON);
this.coupon = json.optString(COUPON, "");
this.couponsetUuid = json.optString(COUPONSET_UUID);
this.discount = json.optString(DISCOUNT);
if (this.discount.contains(",")) {
......