mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
fix: handle empty xtream categories gracefully
Skip database insert when categories array is empty to prevent 'values() must be called with at least one value' error. Closes #684
This commit is contained in:
1 parent
2043b7d8a1
commit
bc30acf4a7
1 file changed
+5
@@ -75,6 +75,11 @@ ipcMain.handle(
|
||||
type: 'live' | 'movies' | 'series'
|
||||
) => {
|
||||
try {
|
||||
// Skip if no categories to save
|
||||
if (!categories || categories.length === 0) {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
const db = await getDatabase();
|
||||
const values = categories.map((cat) => ({
|
||||
playlistId,
|
||||
|
||||
Reference in new issue
Block a user