Fix NPE issue in restore REST call