Fix one NPE when client is null in scripts