Fix coverity report -- missing check on AliRawReader::NextEvent() when attempting...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Dec 2010 11:57:49 +0000 (11:57 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Dec 2010 11:57:49 +0000 (11:57 +0000)
EVE/EveBase/AliEveEventManager.cxx

index 4b0811d..4d38ed3 100644 (file)
@@ -545,7 +545,9 @@ void AliEveEventManager::Open()
     if (fgAssertRaw)
     {
       throw (kEH + "raw-data not initialized. Its precence was requested.");
-    } else {
+    }
+    else
+    {
       Warning(kEH, "raw-data not initialized.");
     }
   }
@@ -554,11 +556,16 @@ void AliEveEventManager::Open()
   {
     if (fRawReader)
     {
-      fRawReader->NextEvent();
+      if ( ! fRawReader->NextEvent())
+      {
+       throw (kEH + "can not go to first event in raw-reader to determine run-id.");
+      }
       runNo = fRawReader->GetRunNumber();
       Info(kEH, "Determining run-no from raw ... run=%d.", runNo);
       fRawReader->RewindEvents();
-    } else {
+    }
+    else 
+    {
       throw (kEH + "unknown run number.");
     }
   }