From fd38eb426fb0e3cce386e666a9c4e449ce8d4382 Mon Sep 17 00:00:00 2001 From: Vitali Graf Date: Sun, 14 Dec 2025 15:09:52 +0100 Subject: [PATCH] Erweiterte Validierung der Tool-Konfigurationspfade mit hasattr-Checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zusätzliche Sicherheitsprüfungen für path_to_binary_file, path_to_jar_file, path_to_dir und path_to_root_dir Attribute, um NoneType-Fehler zu vermeiden. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/ui/MainWindow.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ui/MainWindow.py b/src/ui/MainWindow.py index c21485d..12519db 100644 --- a/src/ui/MainWindow.py +++ b/src/ui/MainWindow.py @@ -3101,6 +3101,27 @@ class MainWindow(QMainWindow): ) return None + # Zusätzliche Sicherheitsprüfung für path_to_binary_file Attribute + if java_vm is None or not hasattr(java_vm, 'path_to_binary_file') or java_vm.path_to_binary_file is None: + QMessageBox.warning(self, "Konfigurationsfehler", "Java VM Pfad ist nicht konfiguriert") + return None + + if saxon_jar is None or not hasattr(saxon_jar, 'path_to_jar_file') or saxon_jar.path_to_jar_file is None: + QMessageBox.warning(self, "Konfigurationsfehler", "Saxon JAR Pfad ist nicht konfiguriert") + return None + + if apache_fop is None or not hasattr(apache_fop, 'path_to_dir') or apache_fop.path_to_dir is None: + QMessageBox.warning(self, "Konfigurationsfehler", "Apache FOP Pfad ist nicht konfiguriert") + return None + + if diff_pdf is None or not hasattr(diff_pdf, 'path_to_binary_file') or diff_pdf.path_to_binary_file is None: + QMessageBox.warning(self, "Konfigurationsfehler", "diff-pdf Pfad ist nicht konfiguriert") + return None + + if xsl_dir is None or not hasattr(xsl_dir, 'path_to_root_dir') or xsl_dir.path_to_root_dir is None: + QMessageBox.warning(self, "Konfigurationsfehler", "XSL-Verzeichnis Pfad ist nicht konfiguriert") + return None + # Erstelle absoluten Pfad zur XSL-Datei xsl_file_abs = xsl_dir.path_to_root_dir / xsl_file_obj.xsl_file