File tree Expand file tree Collapse file tree 1 file changed +21
-17
lines changed
erxeslibrary/src/main/java/com/newmedia/erxeslibrary/configuration Expand file tree Collapse file tree 1 file changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -420,28 +420,32 @@ public Builder(@NonNull String brand) {
420
420
}
421
421
422
422
public Builder setApiHost (String apiHost ) {
423
- if (apiHost .contains ("://" )) {
424
- this .protocal = apiHost .substring (0 , apiHost .indexOf ("://" ));
425
- this .apiHost = apiHost .substring (apiHost .indexOf ("://" ) + 3 );
426
- } else {
427
- this .apiHost = apiHost ;
428
- }
429
-
430
- if (this .apiHost .contains ("/" ) && String .valueOf (this .apiHost .charAt (this .apiHost .length () - 1 )).equals ("/" )) {
431
- this .apiHost = this .apiHost .substring (0 , this .apiHost .length () - 1 );
423
+ if (apiHost != null ) {
424
+ if (apiHost .contains ("://" )) {
425
+ this .protocal = apiHost .substring (0 , apiHost .indexOf ("://" ));
426
+ this .apiHost = apiHost .substring (apiHost .indexOf ("://" ) + 3 );
427
+ } else {
428
+ this .apiHost = apiHost ;
429
+ }
430
+
431
+ if (this .apiHost .contains ("/" ) && String .valueOf (this .apiHost .charAt (this .apiHost .length () - 1 )).equals ("/" )) {
432
+ this .apiHost = this .apiHost .substring (0 , this .apiHost .length () - 1 );
433
+ }
434
+
435
+ setGqlApiHost ();
436
+ setSubscriptionHost ();
437
+ setUploadHost ();
432
438
}
433
-
434
- setGqlApiHost ();
435
- setSubscriptionHost ();
436
- setUploadHost ();
437
439
return this ;
438
440
}
439
441
440
442
public Builder setOrganizationName (String organizationName ) {
441
- this .apiHost = organizationName + ".app.erxes.io/api" ;
442
- setGqlApiHost ();
443
- setSubscriptionHost ();
444
- setUploadHost ();
443
+ if (organizationName != null ) {
444
+ this .apiHost = organizationName + ".app.erxes.io/api" ;
445
+ setGqlApiHost ();
446
+ setSubscriptionHost ();
447
+ setUploadHost ();
448
+ }
445
449
return this ;
446
450
}
447
451
You can’t perform that action at this time.
0 commit comments