Fix for NPE during saving of create trial

Code review : Daniel Jao