fix(dbmerger): merge reserved table, Exception due null time in avatar_history #461

Closed
opened 2026-04-05 16:19:32 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @book000 on 5/4/2025

Thank you for developing this application.
This pull request contains changes to DBMerger.

Fix the following two problems:

  1. Avoiding errors by merging reserved SQLite tables “sqlite_sequence”
  2. Avoid NullPointerException due to newAvatarTime being null

1. Avoiding errors by merging reserved SQLite tables “sqlite_sequence”

When performing a merge, it tries to merge the sqlite_sequence table and therefore tries to create a reserved SQLite table (prefixed “sqlite_”), resulting in the following error

SQLite.SQLiteException: object name reserved for internal use: sqlite_sequence

Exclude tables beginning with "sqlite_" from the merge tables.
Also, to avoid appearing in “Found unmerged table”, skip it after removing it from unMergedTables.

2. Avoid NullPointerException due to newAvatarTime being null

When merging the "avatar_history" table, there seems to be a case where the time column in the new DB is NULL.

System.NullReferenceException: 'Object reference not set to an instance of an object.'

In this case, a NullPointerException will be raised and an error will occur, so the case of NULL will be handled as time=0 to avoid the error.

*Originally created by @book000 on 5/4/2025* Thank you for developing this application. This pull request contains changes to DBMerger. Fix the following two problems: 1. Avoiding errors by merging reserved SQLite tables “sqlite_sequence” 2. Avoid NullPointerException due to newAvatarTime being null ## 1. Avoiding errors by merging reserved SQLite tables “sqlite_sequence” When performing a merge, it tries to merge the sqlite_sequence table and therefore tries to create a reserved SQLite table (prefixed “sqlite_”), resulting in the following error ``` SQLite.SQLiteException: object name reserved for internal use: sqlite_sequence ``` Exclude tables beginning with "sqlite_" from the merge tables. Also, to avoid appearing in “Found unmerged table”, skip it after removing it from `unMergedTables`. ## 2. Avoid NullPointerException due to newAvatarTime being null When merging the "avatar_history" table, there seems to be a case where the time column in the new DB is NULL. ``` System.NullReferenceException: 'Object reference not set to an instance of an object.' ``` In this case, a NullPointerException will be raised and an error will occur, so the case of NULL will be handled as time=0 to avoid the error.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/VRCX#461