Fix: Dereference of null pointer in transparent.cpp
This commit is contained in:
parent
1231b9f65d
commit
a2d69f5e7b
|
@ -105,7 +105,9 @@ void Transparent::draw()
|
|||
//----------------------------------------------------------------------
|
||||
void Transparent::onKeyPress (FKeyEvent* ev)
|
||||
{
|
||||
if ( ev && ev->key() == 'q' && getParentWidget() )
|
||||
if ( ev )
|
||||
{
|
||||
if ( ev->key() == 'q' && getParentWidget() )
|
||||
{
|
||||
if ( getParentWidget()->close() )
|
||||
ev->accept();
|
||||
|
@ -114,6 +116,7 @@ void Transparent::onKeyPress (FKeyEvent* ev)
|
|||
}
|
||||
else
|
||||
FDialog::onKeyPress(ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +147,9 @@ class MainWindow : public FDialog
|
|||
void onTimer (FTimerEvent*);
|
||||
void onKeyPress (FKeyEvent* ev)
|
||||
{
|
||||
if ( ev && ev->key() == 'q' )
|
||||
if ( ev )
|
||||
{
|
||||
if ( ev->key() == 'q' )
|
||||
{
|
||||
close();
|
||||
ev->accept();
|
||||
|
@ -152,6 +157,7 @@ class MainWindow : public FDialog
|
|||
else
|
||||
FDialog::onKeyPress(ev);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
|
|
Loading…
Reference in New Issue