aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index 0e30a26..90bc8ad 100644
--- a/main.c
+++ b/main.c
@@ -26,6 +26,9 @@ int main(int argc, char *argv[])
}
struct json_object *obj = drm_info(&argv[optind]);
+ if (!obj) {
+ exit(EXIT_FAILURE);
+ }
if (json) {
json_object_to_fd(STDOUT_FILENO, obj,
JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED);