From 3995cb5391b08fe3a1394e275776150ba85d8adb Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <gemmeren@anl.gov>
Date: Tue, 20 Jun 2017 14:06:31 -0500
Subject: [PATCH] Fix for full commit, write baskets only if file is writeable
 to avoid ROOT warning.

---
 Database/APR/RootStorageSvc/src/RootDatabase.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Database/APR/RootStorageSvc/src/RootDatabase.cpp b/Database/APR/RootStorageSvc/src/RootDatabase.cpp
index 3cfe6725b04..01e194f2f78 100644
--- a/Database/APR/RootStorageSvc/src/RootDatabase.cpp
+++ b/Database/APR/RootStorageSvc/src/RootDatabase.cpp
@@ -767,7 +767,7 @@ void RootDatabase::registerBranchContainer(RootTreeContainer* cont)
 DbStatus RootDatabase::transAct(DbTransaction&  refTr )
 {
    // process flush to write file
-   if( refTr.state() == Transaction::TRANSACT_FLUSH ) m_file->Write();
+   if( refTr.state() == Transaction::TRANSACT_FLUSH && m_file != nullptr && m_file->IsWritable()) m_file->Write();
    // process commits only
    if( refTr.state() != Transaction::TRANSACT_COMMIT )
       return Success;
-- 
GitLab