From 657e01125aa49577a62a5531fde24cbcc007006d Mon Sep 17 00:00:00 2001 From: Christian Kastner Date: Tue, 14 Jul 2026 12:15:41 +0200 Subject: [PATCH] tests: export-graph-ops: exit gracefully when called w/o arguments (#25619) Fixes a segfault when `test-export-graph-ops` is called without any arguments. --- tests/test-export-graph-ops.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-export-graph-ops.cpp b/tests/test-export-graph-ops.cpp index 7d8118dcd6..46ded13985 100644 --- a/tests/test-export-graph-ops.cpp +++ b/tests/test-export-graph-ops.cpp @@ -152,6 +152,10 @@ int main(int argc, char ** argv) { init_result = common_init_from_params(params); ctx = init_result->context(); + if (!ctx) { + LOG_ERR("failed to initialize params\n"); + return 1; + } } else { #ifdef LLAMA_HF_FETCH auto [hf_repo, hf_quant] = common_download_split_repo_tag(params.model.hf_repo);