forked from enlightenment/edi
mainview_panel: do safe checks before accessing panel->current->view
Reviewers: ajwillia.ms Differential Revision: https://phab.enlightenment.org/D5149
This commit is contained in:
parent
8925c72adf
commit
1ed7c297cb
|
@ -452,6 +452,9 @@ edi_mainview_panel_save(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
if (!editor)
|
||||
return;
|
||||
|
@ -464,6 +467,9 @@ edi_mainview_panel_undo(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -491,6 +497,9 @@ edi_mainview_panel_redo(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -533,6 +542,9 @@ edi_mainview_panel_cut(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -544,6 +556,9 @@ edi_mainview_panel_copy(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -555,6 +570,9 @@ edi_mainview_panel_paste(Edi_Mainview_Panel *panel)
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -568,6 +586,9 @@ edi_mainview_panel_search(Edi_Mainview_Panel *panel)
|
|||
|
||||
if (edi_mainview_is_empty()) return;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
|
||||
if (editor)
|
||||
|
@ -579,6 +600,9 @@ edi_mainview_panel_goto(Edi_Mainview_Panel *panel, unsigned int number)
|
|||
{
|
||||
if (edi_mainview_is_empty()) return;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
edi_mainview_panel_goto_position(panel, number, 1);
|
||||
}
|
||||
|
||||
|
@ -587,6 +611,9 @@ edi_mainview_panel_goto_position(Edi_Mainview_Panel *panel, unsigned int row, un
|
|||
{
|
||||
Edi_Editor *editor;
|
||||
|
||||
if (!panel || !panel->current)
|
||||
return;
|
||||
|
||||
editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
|
||||
if (!editor || row <= 0 || col <= 0)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue