Skip to content

Commit

Permalink
Check if object is null
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <[email protected]>
  • Loading branch information
xw19 committed Dec 1, 2024
1 parent 16bbd91 commit 92f7eed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ocispec/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ def parse_json_to_c(obj, c_file, prefix):
c_file.append(" (void) ctx; /* Silence compiler warning. */\n")
c_file.append(" if (tree == NULL)\n")
c_file.append(" return NULL;\n")
c_file.append(" if (json_is_null(tree))\n")
c_file.append(" return NULL;\n")
c_file.append(" ret = calloc (1, sizeof (*ret));\n")
c_file.append(" if (ret == NULL)\n")
c_file.append(" return NULL;\n")
Expand Down

0 comments on commit 92f7eed

Please sign in to comment.