Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de3ba0d0 authored by stefan-niedermann's avatar stefan-niedermann
Browse files

Fix #613 Crash on start. shortLabel cannot be empty

parent 3ac8b2e1
Loading
Loading
Loading
Loading
+19 −13
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@@ -153,15 +154,20 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
                        List<ShortcutInfo> newShortcuts = new ArrayList<>();

                        for (DBNote note : db.getRecentNotes(localAccount.getId())) {
                            if (!TextUtils.isEmpty(note.getTitle())) {
                                Intent intent = new Intent(getApplicationContext(), EditNoteActivity.class);
                                intent.putExtra(EditNoteActivity.PARAM_NOTE_ID, note.getId());
                                intent.setAction(ACTION_SHORTCUT);

                                newShortcuts.add(new ShortcutInfo.Builder(getApplicationContext(), note.getId() + "")
                                    .setShortLabel(note.getTitle())
                                        .setShortLabel(note.getTitle() + "")
                                        .setIcon(Icon.createWithResource(getApplicationContext(), note.isFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp))
                                        .setIntent(intent)
                                        .build());
                            } else {
                                // Prevent crash https://github.com/stefan-niedermann/nextcloud-notes/issues/613
                                Log.e(TAG, "shortLabel cannot be empty " + note);
                            }
                        }
                        Log.d(TAG, "Update dynamic shortcuts");
                        shortcutManager.removeAllDynamicShortcuts();
+1 −0
Original line number Diff line number Diff line
- #171 Multiple NC Servers
- #375 Hardcoded list for special category images
- #418 Implement Single-Sign-On
- #613 Crash on start. shortLabel cannot be empty
- Hide FAB when scrolling down
 No newline at end of file