Skip to content

Commit

Permalink
Check for NULL pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Jul 6, 2020
1 parent 79b093c commit 81768a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OMEdit/OMEditLIB/Plotting/PlotWindowContainer.cpp
Expand Up @@ -202,7 +202,7 @@ QMdiSubWindow* PlotWindowContainer::getDiagramSubWindowFromMdi()
*/
bool PlotWindowContainer::isPlotWindow(QObject *pObject)
{
if (0 != pObject->objectName().compare("animationWindow")
if (pObject && 0 != pObject->objectName().compare("animationWindow")
&& 0 != pObject->objectName().compare("diagramWindow")) {
return true;
}
Expand All @@ -217,7 +217,7 @@ bool PlotWindowContainer::isPlotWindow(QObject *pObject)
*/
bool PlotWindowContainer::isAnimationWindow(QObject *pObject)
{
if (0 == pObject->objectName().compare("animationWindow")) {
if (pObject && 0 == pObject->objectName().compare("animationWindow")) {
return true;
}
return false;
Expand All @@ -231,7 +231,7 @@ bool PlotWindowContainer::isAnimationWindow(QObject *pObject)
*/
bool PlotWindowContainer::isDiagramWindow(QObject *pObject)
{
if (0 == pObject->objectName().compare("diagramWindow")) {
if (pObject && 0 == pObject->objectName().compare("diagramWindow")) {
return true;
}
return false;
Expand Down

0 comments on commit 81768a1

Please sign in to comment.