From f640d86e9cceb8c301b9689690e48575ccb74495 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Tue, 16 Aug 2022 09:39:40 +0100 Subject: [PATCH] Backup manager bug Error if no database. Fixed. --- src/backupmanager/database/DatabaseCatalog.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/backupmanager/database/DatabaseCatalog.java b/src/backupmanager/database/DatabaseCatalog.java index 28200477..27c6c95e 100644 --- a/src/backupmanager/database/DatabaseCatalog.java +++ b/src/backupmanager/database/DatabaseCatalog.java @@ -59,13 +59,15 @@ public class DatabaseCatalog extends BackupCatalog { actionMap.put(action, ++ind); } makeTableDefinition(); - + dbControlUnit = DBControlUnit.findDatabaseControl(); - pamConnection = dbControlUnit.getConnection(); - DBProcess dbProcess = dbControlUnit.getDbProcess(); - boolean tableOk = dbProcess.checkTable(fullTableDef); - if (tableOk == false) { - System.err.println("Error checking backup table " + fullTableDef.getTableName()); + if (dbControlUnit != null) { + pamConnection = dbControlUnit.getConnection(); + DBProcess dbProcess = dbControlUnit.getDbProcess(); + boolean tableOk = dbProcess.checkTable(fullTableDef); + if (tableOk == false) { + System.err.println("Error checking backup table " + fullTableDef.getTableName()); + } } }