Skip to content

Commit a2860ff

Browse files
TomTascheclaude
andcommitted
Fix Pro flavor check ordering in BillingManager
Move Pro flavor detection before enabled check to ensure billingPreferences is always initialized for Pro users. This prevents null pointer issues in hasPurchased() that were causing Pro users to see upgrade prompts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 59823de commit a2860ff

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

app/src/main/java/at/tomtasche/reader/nonfree/BillingManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ public class BillingManager {
1616
public void initialize(Context context, AnalyticsManager analyticsManager, AdManager adManager) {
1717
this.adManager = adManager;
1818

19-
// Handle Pro flavor first, regardless of enabled state
19+
billingPreferences = new BillingPreferences(context);
20+
2021
if (BuildConfig.FLAVOR.equals("pro")) {
21-
adManager.removeAds();
22-
return;
22+
billingPreferences.setPurchased(true);
2323
}
2424

2525
if (!enabled) {
2626
adManager.showGoogleAds();
2727
return;
2828
}
2929

30-
billingPreferences = new BillingPreferences(context);
3130
enforceAds();
3231
}
3332

0 commit comments

Comments
 (0)