Fix NPE when resuming state