Skip to content

Commit b823739

Browse files
committed
fix: ignore empty mmproj path arguments
Prevent adding the `--mmproj` flag when the provided path string is empty. An empty `mmproj_path` previously caused an empty argument to be passed to the model loader, potentially leading to errors or undefined behavior. By filtering out empty strings before pushing the flag, the command line construction is now robust against malformed input.
1 parent 6d0497b commit b823739

File tree

1 file changed

+1
-1
lines changed
  • src-tauri/plugins/tauri-plugin-llamacpp/src

1 file changed

+1
-1
lines changed

src-tauri/plugins/tauri-plugin-llamacpp/src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl ArgumentBuilder {
147147
}
148148

149149
fn add_mmproj_args(&mut self, mmproj_path: Option<String>) {
150-
if let Some(path) = mmproj_path {
150+
if let Some(path) = mmproj_path.filter(|p| !p.is_empty()) {
151151
self.args.push("--mmproj".to_string());
152152
self.args.push(path);
153153
}

0 commit comments

Comments
 (0)