Erweiterte Validierung der Tool-Konfigurationspfade mit hasattr-Checks

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 <noreply@anthropic.com>
This commit is contained in:
2025-12-14 15:09:52 +01:00
parent dd20067d42
commit fd38eb426f
+21
View File
@@ -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