mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 02:01:56 +00:00
fix potential crashes
This commit is contained in:
parent
a1fa9af152
commit
5905af486b
3 changed files with 16 additions and 13 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="147"
|
||||
android:versionCode="148"
|
||||
android:versionName="0.0.36"
|
||||
android:screenOrientation="portrait"
|
||||
android:installLocation="auto" >
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ public class PopupNotificationsManager {
|
|||
}
|
||||
|
||||
HabiticaApplication.currentActivity.runOnUiThread(() -> {
|
||||
if (HabiticaApplication.currentActivity == null) return;
|
||||
if ((HabiticaApplication.currentActivity).isFinishing()) return;
|
||||
|
||||
if (this.seenNotifications == null) {
|
||||
|
|
|
|||
|
|
@ -386,23 +386,25 @@ public class HabitRPGUser extends BaseModel {
|
|||
|
||||
List<Challenge> challenges = getChallengeList();
|
||||
|
||||
for (String s : getChallenges()) {
|
||||
boolean challengeExistInDatabase = false;
|
||||
if (getChallenges() != null) {
|
||||
for (String s : getChallenges()) {
|
||||
boolean challengeExistInDatabase = false;
|
||||
|
||||
for (Challenge challenge : challenges) {
|
||||
if (challenge.id.equals(s)) {
|
||||
challengeExistInDatabase = true;
|
||||
for (Challenge challenge : challenges) {
|
||||
if (challenge.id.equals(s)) {
|
||||
challengeExistInDatabase = true;
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!challengeExistInDatabase) {
|
||||
Challenge challenge = new Challenge();
|
||||
challenge.id = s;
|
||||
challenge.user_id = id;
|
||||
if (!challengeExistInDatabase) {
|
||||
Challenge challenge = new Challenge();
|
||||
challenge.id = s;
|
||||
challenge.user_id = id;
|
||||
|
||||
challenges.add(challenge);
|
||||
challenges.add(challenge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue