LIVEOAK-479

Fix NPE when trying to create and update scripts through the endpoints.