Permalink
Browse files

Update contentsidebartoolbox.lua

Fixes an error when you delete the spawnlists tab ( even to you shouldn't )
  • Loading branch information...
1 parent 5400467 commit c0d265d81a72e5b54fd83f06b148748bbf446fdb @robotboy655 robotboy655 committed Aug 27, 2014
@@ -25,11 +25,11 @@ function PANEL:Init()
Button.OnDrop = function( self, target )
- local label = vgui.Create( "ContentHeader", target )
- return label
-
- end
+ local label = vgui.Create( "ContentHeader", target )
+ return label
+ end
+
local panel = vgui.Create( "DPanel", self )
panel:Dock( FILL )
panel:DockPadding( 5, 5, 5, 5 )
@@ -45,6 +45,8 @@ function PANEL:Init()
--
hook.Add( "ContentSidebarSelection", "SidebarToolboxSelection", function( pnlContent, node )
+ if ( !IsValid( node ) ) then return end
+
label:SetText( node:GetText() )
icons:SelectIcon( node:GetIcon() )
icons:ScrollToSelected()

0 comments on commit c0d265d

Please sign in to comment.