File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/local/bookmark Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,12 +446,10 @@ private void saveImmediate() {
446446 final Long databaseIndex = displayIndexInDatabase .remove (key );
447447
448448 // The database index should not be null because inserting new item into database
449- // is not dealt here. NullPointerException has occurred once, but I can't reproduce
450- // it. Enhance robustness here.
451- if (databaseIndex != null ) {
452- if (databaseIndex != i ) {
453- localItemsUpdate .add ((PlaylistMetadataEntry ) item );
454- }
449+ // is not handled here. NullPointerException has occurred once, but I can't
450+ // reproduce it. Enhance robustness here.
451+ if (databaseIndex != null && databaseIndex != i ) {
452+ localItemsUpdate .add ((PlaylistMetadataEntry ) item );
455453 }
456454 } else if (item instanceof PlaylistRemoteEntity ) {
457455 ((PlaylistRemoteEntity ) item ).setDisplayIndex (i );
@@ -461,10 +459,8 @@ private void saveImmediate() {
461459 LocalItem .LocalItemType .PLAYLIST_REMOTE_ITEM );
462460 final Long databaseIndex = displayIndexInDatabase .remove (key );
463461
464- if (databaseIndex != null ) {
465- if (databaseIndex != i ) {
466- remoteItemsUpdate .add ((PlaylistRemoteEntity ) item );
467- }
462+ if (databaseIndex != null && databaseIndex != i ) {
463+ remoteItemsUpdate .add ((PlaylistRemoteEntity ) item );
468464 }
469465 }
470466 }
You can’t perform that action at this time.
0 commit comments