Dont run onsidetoggled if tree view is off

Causes a crash because you can't detach stuff that doesn't exist