Commit 85da5043 authored by Thomas's avatar Thomas
Browse files

Fix #144 - Null pointer on BottomMenu

parent 87eba3db
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ public class BottomMenu implements Serializable {
    }

    public static int getPosition(BottomMenu bottomMenu, @IdRes int idRes) {
        if (bottomMenu != null && bottomMenu.bottom_menu != null) {
            for (MenuItem menuItem : bottomMenu.bottom_menu) {
                if (idRes == R.id.nav_home && menuItem.item_menu_type == ItemMenuType.HOME) {
                    return menuItem.position;
@@ -106,6 +107,7 @@ public class BottomMenu implements Serializable {
                    return menuItem.position;
                }
            }
        }
        return -1;
    }

+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
     */
    private void manageMentions(Context context, Status statusDraft, ComposeViewHolder holder) {

        if (statusDraft.mentions != null && (statusDraft.text == null || statusDraft.text.length() == 0)) {
        if (statusDraft.mentions != null && (statusDraft.text == null || statusDraft.text.length() == 0) && statusDraft.mentions.size() > 0) {
            //Retrieves mentioned accounts + OP and adds them at the beginin of the toot
            final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
            Mention inReplyToUser = null;