$util is deprecated and should not be used.

See http://wiki.apache.org/velocity/CheckingForNull

But if getWorkspaces() returns a lit you should use isEmpty()...

Also you need to make sure you handle the case when the workspace script service doesn't exist.