Merge branch 'issue-67' into 'develop'

Fix NullPointerException (#67)

Closes #67

See merge request tom79/nitterizeme!149
This commit is contained in:
Thomas 2022-05-17 05:43:33 +00:00
commit f49b4b0974
1 changed files with 7 additions and 7 deletions

View File

@ -14,6 +14,12 @@ package app.fedilab.nitterizeme.activities;
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.nitterizeme.activities.MainActivity.APP_PREFS;
import static app.fedilab.nitterizeme.helpers.Utils.INTENT_ACTION;
import static app.fedilab.nitterizeme.helpers.Utils.KILL_ACTIVITY;
import static app.fedilab.nitterizeme.helpers.Utils.LAST_USED_APP_PACKAGE;
import static app.fedilab.nitterizeme.helpers.Utils.URL_APP_PICKER;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
@ -39,12 +45,6 @@ import app.fedilab.nitterizeme.helpers.Utils;
import app.fedilab.nitterizeme.sqlite.DefaultAppDAO;
import app.fedilab.nitterizeme.sqlite.Sqlite;
import static app.fedilab.nitterizeme.activities.MainActivity.APP_PREFS;
import static app.fedilab.nitterizeme.helpers.Utils.INTENT_ACTION;
import static app.fedilab.nitterizeme.helpers.Utils.KILL_ACTIVITY;
import static app.fedilab.nitterizeme.helpers.Utils.LAST_USED_APP_PACKAGE;
import static app.fedilab.nitterizeme.helpers.Utils.URL_APP_PICKER;
public class AppsPickerActivity extends Activity {
@ -179,7 +179,7 @@ public class AppsPickerActivity extends Activity {
long val = -1;
if (isPresent) {
ArrayList<String> oldConcurrent = new DefaultAppDAO(AppsPickerActivity.this, db).getConcurrent(appToUse);
ArrayList<String> newConcurrent = Utils.union(oldConcurrent, packages);
ArrayList<String> newConcurrent = oldConcurrent != null ? Utils.union(oldConcurrent, packages) : packages;
newConcurrent.remove(appToUse);
new DefaultAppDAO(AppsPickerActivity.this, db).update(appToUse, newConcurrent);
} else {