diff --git a/macos/QMK Toolbox/MainViewController.swift b/macos/QMK Toolbox/MainViewController.swift index 08d0f3a7b5..cdf5e98c94 100644 --- a/macos/QMK Toolbox/MainViewController.swift +++ b/macos/QMK Toolbox/MainViewController.swift @@ -120,6 +120,11 @@ class MainViewController: NSViewController, USBListenerDelegate { return } + guard FileManager.default.fileExists(atPath: file) else { + logTextView.logError("File does not exist") + return + } + guard mcuBox.indexOfSelectedItem > 0 else { logTextView.logError("Please select a microcontroller") return diff --git a/windows/QMK Toolbox/MainWindow.cs b/windows/QMK Toolbox/MainWindow.cs index 482c99f795..ecbd13004f 100644 --- a/windows/QMK Toolbox/MainWindow.cs +++ b/windows/QMK Toolbox/MainWindow.cs @@ -271,6 +271,12 @@ private async void FlashAllAsync() return; } + if (!File.Exists(filePath)) + { + logTextBox.LogError("File does not exist!"); + return; + } + if (!windowState.AutoFlashEnabled) { Invoke(new Action(DisableUI));