fix throw exception

This commit is contained in:
MyDrift 2024-08-22 21:18:51 +02:00
parent 7e3d124a24
commit f284173767

View File

@ -36,10 +36,8 @@ function Invoke-WPFUIElements {
throw "Failed to retrieve Styles using 'FindResource' from main window element." throw "Failed to retrieve Styles using 'FindResource' from main window element."
} }
try { if (!$targetGrid) {
$targetGrid = $window.FindName($targetGridName) throw "Failed to retrieve Target Grid by name, provided name: $targetGrid"
} catch {
throw "Failed to find the target grid '$targetGridName' in the main window."
} }
# Clear existing ColumnDefinitions and Children # Clear existing ColumnDefinitions and Children