File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed
plugins/sdk-plugin-webbridge/src/main/java/com/adjust/sdk/webbridge
sdk-core/src/main/java/com/adjust/sdk Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -382,8 +382,9 @@ public boolean launchReceivedDeeplink(Uri deeplink) {
382382 // store info
383383 String storeName = AdjustBridgeUtil .fieldToString (storeInfoNameField );
384384 String storeAppId = AdjustBridgeUtil .fieldToString (storeInfoAppIdField );
385- if (storeName != null || storeAppId != null ) {
386- AdjustStoreInfo adjustStoreInfo = new AdjustStoreInfo (storeName , storeAppId );
385+ if (storeName != null ) {
386+ AdjustStoreInfo adjustStoreInfo = new AdjustStoreInfo (storeName );
387+ adjustStoreInfo .setStoreAppId (storeAppId );
387388 adjustConfig .setAdjustStoreInfo (adjustStoreInfo );
388389 }
389390
Original file line number Diff line number Diff line change @@ -4,16 +4,29 @@ public class AdjustStoreInfo {
44 String storeName ;
55 String storeAppId ;
66
7- public AdjustStoreInfo (String storeName , String storeAppId ) {
7+ private static final ILogger logger = AdjustFactory .getLogger ();
8+
9+ public AdjustStoreInfo (String storeName ) {
10+ if (!isValidStore (storeName )) {
11+ return ;
12+ }
13+
814 this .storeName = storeName ;
9- this .storeAppId = storeAppId ;
1015 }
1116
12- public String getStoreName ( ) {
13- return storeName ;
17+ public void setStoreAppId ( String storeAppId ) {
18+ this . storeAppId = storeAppId ;
1419 }
1520
16- public String getStoreAppId () {
17- return storeAppId ;
21+ private boolean isValidStore (final String storeName ) {
22+ if (storeName == null ) {
23+ logger .error ("Missing store name" );
24+ return false ;
25+ }
26+ if (storeName .isEmpty ()) {
27+ logger .error ("Store name can't be empty" );
28+ return false ;
29+ }
30+ return true ;
1831 }
1932}
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ public static AdjustStoreInfo getStoreInfoFromClient(final AdjustConfig adjustCo
3939
4040 String storeAppId = metaData .getString ("ADJUST_STORE_APP_ID" );
4141
42- return new AdjustStoreInfo (storeName , storeAppId );
42+ AdjustStoreInfo storeInfo = new AdjustStoreInfo (storeName );
43+ storeInfo .setStoreAppId (storeAppId );
44+ return storeInfo ;
45+
4346 } catch (Exception e ) {
4447 return adjustConfig .adjustStoreInfo ;
4548 }
You can’t perform that action at this time.
0 commit comments