Check if some function pointers for plugin are null 16/107216/2 accepted/tizen/common/20161227.192559 accepted/tizen/ivi/20161227.091737 accepted/tizen/mobile/20161227.091644 accepted/tizen/tv/20161227.091701 accepted/tizen/wearable/20161227.091717 submit/tizen/20161227.080546
authorchanywa <cbible.kim@samsung.com>
Tue, 27 Dec 2016 07:29:19 +0000 (16:29 +0900)
committerSeechan Kim <cbible.kim@samsung.com>
Tue, 27 Dec 2016 07:42:16 +0000 (23:42 -0800)
Change-Id: Ic7114ff6c96113e43ac77bbe62a0122c54d3ee05

src/api/maps_view.cpp
src/plugin/module.cpp

index 0cf6c25..0499982 100644 (file)
@@ -610,11 +610,21 @@ EXPORT_API int maps_view_create(maps_service_h maps, Evas_Object *obj, maps_view
 
        if (__get_plugin_interface(v)) {
                /* Notify the Plugin, that the view is created */
-               __get_plugin_interface(v)->maps_plugin_create_map_view(*view, __maps_view_ready);
+               if (__get_plugin_interface(v)->maps_plugin_create_map_view)
+                       __get_plugin_interface(v)->maps_plugin_create_map_view(*view, __maps_view_ready);
+               else
+                       MAPS_LOGE("ERROR!! maps_plugin_create_map_view function pointer is null");
 
                /* Set up zoom and rotation */
-               __get_plugin_interface(v)->maps_plugin_get_min_zoom_level(v, &v->min_zoom_level);
-               __get_plugin_interface(v)->maps_plugin_get_max_zoom_level(v, &v->max_zoom_level);
+               if (__get_plugin_interface(v)->maps_plugin_get_min_zoom_level)
+                       __get_plugin_interface(v)->maps_plugin_get_min_zoom_level(v, &v->min_zoom_level);
+               else
+                       MAPS_LOGE("ERROR!! maps_plugin_get_min_zoom_level function pointer is null");
+
+               if (__get_plugin_interface(v)->maps_plugin_get_max_zoom_level)
+                       __get_plugin_interface(v)->maps_plugin_get_max_zoom_level(v, &v->max_zoom_level);
+               else
+                       MAPS_LOGE("ERROR!! maps_plugin_get_max_zoom_level function pointer is null");
        }
 
        if (v->min_zoom_level <= 0)
@@ -682,7 +692,12 @@ EXPORT_API int maps_view_destroy(maps_view_h view)
                ecore_animator_del(v->animator);
 
        /* Notify the Plugin, that the view is to be destroyed */
-       __get_plugin_interface(view)->maps_plugin_destroy_map_view(view);
+       if (__get_plugin_interface(view)) {
+               if (__get_plugin_interface(view)->maps_plugin_destroy_map_view)
+                       __get_plugin_interface(view)->maps_plugin_destroy_map_view(view);
+               else
+                       MAPS_LOGE("ERROR!! maps_plugin_destroy_map_view function pointer is null");
+       }
 
        /* Destroy a visual panel */
        if (v->panel)
index fe018fa..3275878 100644 (file)
@@ -507,6 +507,11 @@ void plugin::binary_extractor::trace_dbg(const plugin_s *plugin) const
 
        MAPS_LOGD("maps_plugin_cancel_request:\t\t%p",
                itf->maps_plugin_cancel_request);
+
+       MAPS_LOGD("maps_plugin_create_map_view:\t\t%p",
+               itf->maps_plugin_create_map_view);
+       MAPS_LOGD("maps_plugin_destroy_map_view:\t\t%p",
+               itf->maps_plugin_destroy_map_view);
        MAPS_LOGD("maps_plugin_capture_snapshot:\t\t%p",
                itf->maps_plugin_capture_snapshot);
        MAPS_LOGD("*********************************************");