Fix #1040: fix panic when snapshot dir doesn't exist