X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FMLDB.java;h=16e46e68a6439d8b6fd6725fa928291375af18db;hb=0ef53a968c083b3c4d054eed72febf3610538dc2;hp=03b207c8f02c017e1643e131e1a8ac6b3acde32e;hpb=4279b12443f6106017e9f33a5c9e21caf67ec64d;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java index 03b207c8..16e46e68 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -165,9 +165,7 @@ public final class MLDB { String sql; String[] params; if (profileSpecific) { - MobileLedgerProfile p = (profile == null) ? Data.profile.getValue() : profile; - if (p == null) - throw new AssertionError(); + MobileLedgerProfile p = (profile == null) ? Data.getProfile() : profile; sql = String.format( "SELECT rowid as _id, %s, CASE WHEN %s_upper LIKE ?||'%%' THEN 1 " + "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " + @@ -201,8 +199,8 @@ public final class MLDB { (parent, itemView, position, id) -> callback.descriptionSelected( String.valueOf(view.getText()))); } - public static void queryInBackground(@NonNull String statement, @NonNull String[] params, - @NonNull CallbackHelper callbackHelper) { + public static void queryInBackground(@NonNull String statement, String[] params, + @NonNull final CallbackHelper callbackHelper) { /* All callbacks are called in the new (asynchronous) thread! */ Thread t = new Thread(() -> { callbackHelper.onStart();