Skip to content

Commit 0849c93

Browse files
NickSxticlaude
andcommitted
fix: handle nullable productId in QDeferredTransaction construction
Purchase.productId returns String? (via products.firstOrNull()) but QDeferredTransaction.productId expects non-nullable String. Use the same `?: ""` convention as PurchaseRecord.kt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d0a873b commit 0849c93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/src/main/java/com/qonversion/android/sdk/internal/QProductCenterManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ internal class QProductCenterManager internal constructor(
579579
// Review feedback (Task 6): single listener invocation.
580580
// The adapter handles forwarding entitlements to legacy listeners.
581581
val deferredTransaction = QDeferredTransaction(
582-
productId = purchase.productId,
582+
productId = purchase.productId ?: "",
583583
transactionId = purchase.purchaseToken,
584584
originalTransactionId = purchase.orderId,
585585
type = QDeferredTransactionType.Unknown,
@@ -1085,7 +1085,7 @@ internal class QProductCenterManager internal constructor(
10851085
// The adapter handles forwarding entitlements to legacy listeners.
10861086
if (purchaseCallback == null) {
10871087
val deferredTransaction = QDeferredTransaction(
1088-
productId = purchase.productId,
1088+
productId = purchase.productId ?: "",
10891089
transactionId = purchase.purchaseToken,
10901090
originalTransactionId = purchase.orderId,
10911091
type = QDeferredTransactionType.Unknown,

0 commit comments

Comments
 (0)