Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz 2025-04-29 12:38:59 -04:00
commit 73b743654a
3 changed files with 39 additions and 29 deletions

View file

@ -76,7 +76,8 @@ public class BookmarkDB extends DatabaseObject implements Bookmark {
@Override
public String getCategory() {
return record.getString(BookmarkDBAdapter.CATEGORY_COL);
String category = record.getString(BookmarkDBAdapter.CATEGORY_COL);
return category != null ? category : ""; // NOTE: Old data may have stored null
}
public void setComment(String comment) {
@ -92,7 +93,8 @@ public class BookmarkDB extends DatabaseObject implements Bookmark {
@Override
public String getComment() {
return record.getString(BookmarkDBAdapter.COMMENT_COL);
String comment = record.getString(BookmarkDBAdapter.COMMENT_COL);
return comment != null ? comment : ""; // NOTE: Old data may have stored null
}
@Override

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -206,6 +206,11 @@ public class BookmarkDBAdapterV3 extends BookmarkDBAdapter {
return null;
}
if (category == null)
category = "";
if (comment == null)
comment = "";
Table table = tables[typeID];
long nextId = table.getKey() + 1;
long id = ((long) typeID << TYPE_ID_OFFSET) | nextId;