There is small glitch with deleting layers and undoing it:
1. Create document with two layers.
2. Delete layer #0
3. Undo
4. Hide layer #0
5. Hide layer #1
-> Layers vanishes from the list
There are two easy ways to recover from situation:
A. Save and reload the file.
B. Resize the Layers panel.
On the side note, in step 3 deleted layer come back to list, but isn't visible in canvas until hide&unhide.
And you may also want to disable some UI buttons when program starts and there are no open document. At least new layer and new palette color buttons triggers an error. They are already disabled if user closes all the documents.