File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
app/src/main/java/com/eveningoutpost/dexdrip Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -796,6 +796,10 @@ private synchronized void reinject(Reminder reminder) {
796796 // TODO lock?
797797 Log .d (TAG , "child Reinjection position: " + i );
798798 reminders .add (i , reminder );
799+ if (mAdapter == null ) {
800+ Log .d (TAG , "Returning from reinject as no UI adapter" );
801+ return ;
802+ }
799803 mAdapter .notifyItemInserted (i );
800804 final AtomicBoolean corrected = new AtomicBoolean ();
801805
@@ -810,12 +814,9 @@ public void onScrollStateChanged(RecyclerView rv, int state) {
810814 if (highlighted < 2 ) {
811815 Log .d (TAG , "Reinjection: scrolling to: " + i );
812816 recyclerView .smoothScrollToPosition (i );
813- JoH .runOnUiThreadDelayed (new Runnable () {
814- @ Override
815- public void run () {
816- // failsafe
817- correctiveScrolling (i , corrected );
818- }
817+ JoH .runOnUiThreadDelayed (() -> {
818+ // failsafe
819+ correctiveScrolling (i , corrected );
819820 }, 1000 );
820821 } else {
821822 Log .d (TAG , "Not scrolling due to highlighted: " + highlighted );
You can’t perform that action at this time.
0 commit comments