From 658fae8bff321c6a52bc92419a74640e3e894404 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Thu, 29 Feb 2024 15:27:09 +0000
Subject: [PATCH] Update sampler.py: don't read state from 0 bytes resume file

---
 bilby/bilby_mcmc/sampler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bilby/bilby_mcmc/sampler.py b/bilby/bilby_mcmc/sampler.py
index fcd4c9c5a..453584270 100644
--- a/bilby/bilby_mcmc/sampler.py
+++ b/bilby/bilby_mcmc/sampler.py
@@ -382,7 +382,7 @@ class Bilby_MCMC(MCMCSampler):
             If true, resume file was successfully loaded, otherwise false
 
         """
-        if os.path.isfile(self.resume_file) is False:
+        if os.path.isfile(self.resume_file) is False or not os.path.getsize(self.resume_file):
             return False
         import dill
 
-- 
GitLab