The current diagram returns the diagram in the main view.
It returns null if you don't have a diagram in the active tab in the main view (there could be a script, the one you are debugging, or the database builder, or...)
I think it worked the same way back in the v13 days.
Geert