Skip to content

Commit c7a4648

Browse files
committed
fix crash on standalone payment credentials list view
1 parent 19478a9 commit c7a4648

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.39.13]
5+
6+
### Fixed
7+
- Fixed crash when using standalone PaymentCredentialsListView
8+
49
## [0.39.12]
510

611
### Added

ui/src/main/java/io/snabble/sdk/ui/payment/PaymentCredentialsListView.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import io.snabble.sdk.payment.PaymentCredentials;
3030
import io.snabble.sdk.payment.PaymentCredentialsStore;
3131
import io.snabble.sdk.ui.R;
32+
import io.snabble.sdk.ui.SnabbleUI;
3233
import io.snabble.sdk.ui.telemetry.Telemetry;
3334
import io.snabble.sdk.ui.utils.KeyguardUtils;
3435
import io.snabble.sdk.ui.utils.OneShotClickListener;
@@ -84,7 +85,13 @@ public void click() {
8485
if (activity instanceof FragmentActivity) {
8586
SelectPaymentMethodFragment dialogFragment = new SelectPaymentMethodFragment();
8687
Bundle bundle = new Bundle();
87-
bundle.putString(SelectPaymentMethodFragment.ARG_PROJECT_ID, project.getId());
88+
89+
Project p = project;
90+
if (p == null) {
91+
p = SnabbleUI.getProject();
92+
}
93+
94+
bundle.putString(SelectPaymentMethodFragment.ARG_PROJECT_ID, p.getId());
8895
ArrayList<PaymentMethod> types;
8996
if (PaymentCredentialsListView.this.types == null) {
9097
types = new ArrayList<>(Arrays.asList(PaymentMethod.values()));

0 commit comments

Comments
 (0)