Adds defense code for crashing 03/236003/1
authorInkyun Kil <inkyun.kil@samsung.com>
Fri, 12 Jun 2020 01:53:10 +0000 (10:53 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Fri, 12 Jun 2020 01:53:10 +0000 (10:53 +0900)
Change-Id: Id2028dd1509e322837f5061f1f9a11536cbf41ec
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
ambient-viewer/src/stub.cc

index 8ef3226..875cc85 100644 (file)
@@ -181,7 +181,7 @@ extern "C" EXPORT_API int ambient_viewer_destroy(ambient_viewer_h handle) {
 extern "C" EXPORT_API int ambient_viewer_notify_ambient_event(
     ambient_viewer_h handle, ambient_viewer_state_e state,
     ambient_viewer_direction_e dir, bundle *extra) {
-  if (handle == nullptr) {
+  if (handle == nullptr || extra == nullptr) {
     LOGE("Invalid parameter");
     return AMBIENT_VIEWER_ERROR_INVALID_PARAMETER;
   }