Commit 72fb9033 authored by Boris Dorès's avatar Boris Dorès

- added a NULL pointer test

- cosmetic changes
parent e56eff61
......@@ -268,6 +268,11 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
ButtonDown->Hint = "Decrease the plugin priority";
ButtonDown->ShowHint = true;
}
else
{
ButtonUp = NULL;
ButtonDown = NULL;
}
/* panel height */
Height = CleanCheckListBox->Top + CleanCheckListBox->Height
......@@ -284,8 +289,8 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
* started on an item */
if( CleanCheckListBox->ItemIndex == -1 )
{
ButtonUp->Enabled = false;
ButtonDown->Enabled = false;
if ( ButtonUp != NULL ) ButtonUp->Enabled = false;
if ( ButtonDown != NULL ) ButtonDown->Enabled = false;
return;
}
......@@ -295,9 +300,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
return;
/* enable up and down buttons */
if ( b_multi_plugins )
{
if ( CleanCheckListBox->ItemIndex != -1 )
if ( b_multi_plugins && ButtonUp != NULL && ButtonDown != NULL )
{
if ( CleanCheckListBox->ItemIndex == 0 )
ButtonUp->Enabled = false; else ButtonUp->Enabled = true;
......@@ -305,7 +308,6 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
== CleanCheckListBox->Items->Count - 1 )
ButtonDown->Enabled = false; else ButtonDown->Enabled = true;
}
}
/* look for module 'Name' */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment