Skip to content

Commit 657e011

Browse files
authored
tests: export-graph-ops: exit gracefully when called w/o arguments (ggml-org#25619)
Fixes a segfault when `test-export-graph-ops` is called without any arguments.
1 parent 47a3966 commit 657e011

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test-export-graph-ops.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ int main(int argc, char ** argv) {
152152
init_result = common_init_from_params(params);
153153

154154
ctx = init_result->context();
155+
if (!ctx) {
156+
LOG_ERR("failed to initialize params\n");
157+
return 1;
158+
}
155159
} else {
156160
#ifdef LLAMA_HF_FETCH
157161
auto [hf_repo, hf_quant] = common_download_split_repo_tag(params.model.hf_repo);

0 commit comments

Comments
 (0)