Skip to content

Commit

Permalink
[VOSDK] Fix for #1660
Browse files Browse the repository at this point in the history
  • Loading branch information
cpyrgas committed Dec 24, 2024
1 parent 3da23bf commit 6b6cacc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ ACCESS ToolBar



IF oImp IS AppWindow VAR appWnd
IF oImp IS Window VAR appWnd
RETURN appWnd:Toolbar
ENDIF

Expand All @@ -254,7 +254,9 @@ ACCESS ToolBar
/// <include file="Gui.xml" path="doc/ChildAppWindow.ToolBar/*" />
ASSIGN ToolBar(oNewToolBar)

IF ((OBJECT) oNewToolbar) IS ToolBar VAR oTB
// Original code in VO was also checking IsInstanceOf(oImp, #Window) to be true
// Note that below oTB as used in the IS VAR pattern, but still assigned in the next line
IF ((OBJECT) oNewToolbar) IS ToolBar VAR oTB
oTb := oNewToolBar
oImp:ToolBar := oTb
oTb:__SetParent(SELF)
Expand Down

2 comments on commit 6b6cacc

@RobertvanderHulst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for oImp is Window is noed needed at all. oImp is declared as window.

@cpyrgas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, indeed. Guess it only makes sense that it also checks for not NULL. Other similar assigns in the same class does use that pattern now, so maybe let's leave this as well for consistency.

Please sign in to comment.