diff --git a/shell/platform/tizen/channels/platform_view_channel.cc b/shell/platform/tizen/channels/platform_view_channel.cc index 6f71fd4856900..e2fc517712f9a 100644 --- a/shell/platform/tizen/channels/platform_view_channel.cc +++ b/shell/platform/tizen/channels/platform_view_channel.cc @@ -147,16 +147,19 @@ void PlatformViewChannel::HandleMethodCall( auto viewInstance = it->second->Create(viewId, width, height, byteMessage); - view_instances_.insert( - std::pair(viewId, viewInstance)); - - if (engine_ && engine_->text_input_channel) { - Ecore_IMF_Context* context = - engine_->text_input_channel->GetImfContext(); - viewInstance->SetSoftwareKeyboardContext(context); + if (viewInstance) { + view_instances_.insert( + std::pair(viewId, viewInstance)); + + if (engine_ && engine_->text_input_channel) { + Ecore_IMF_Context* context = + engine_->text_input_channel->GetImfContext(); + viewInstance->SetSoftwareKeyboardContext(context); + } + result->Success(flutter::EncodableValue(viewInstance->GetTextureId())); + } else { + result->Error("Can't create a webview instance!!"); } - - result->Success(flutter::EncodableValue(viewInstance->GetTextureId())); } else { FT_LOGE("can't find view type = %s", viewType.c_str()); result->Error("Can't find view type");