Merge "AGM: add check for null pointer before dereference"
diff --git a/service/src/graph.c b/service/src/graph.c
index ec5eea1..46882a2 100644
--- a/service/src/graph.c
+++ b/service/src/graph.c
@@ -1820,6 +1820,11 @@
     int ret = -EINVAL;
     struct agm_buffer_config buffer_config = {0};
 
+    if (graph_obj == NULL) {
+        AGM_LOGE("invalid graph object");
+        return -EINVAL;
+    }
+
     sess_obj = graph_obj->sess_obj;
     if (sess_obj == NULL) {
         AGM_LOGE("invalid sess object");