Avoid crash from getting ledger index before current ledger exists.