From 022ef40d1f5346aa6a6bc97cb53e705974789923 Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Wed, 30 Sep 2020 15:24:43 +0200
Subject: [PATCH] Fix fix

---
 km3io/rootio.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/km3io/rootio.py b/km3io/rootio.py
index 75e6436..f12c39e 100644
--- a/km3io/rootio.py
+++ b/km3io/rootio.py
@@ -174,7 +174,7 @@ class Branch:
     def __len__(self):
         if not self._index_chain:
             return len(self._branch)
-        elif isinstance(self._index_chain[0], (int, np.int32, np.int64)):
+        elif isinstance(self._index_chain[-1], (int, np.int32, np.int64)):
             if len(self._index_chain) == 1:
                 try:
                     return len(self[:])
@@ -191,11 +191,10 @@ class Branch:
     def is_single(self):
         """Returns True when a single branch is selected."""
         if len(self._index_chain) > 0:
-            if isinstance(self._index_chain[-1], (int, np.int32, np.int64)):
+            if isinstance(self._index_chain[0], (int, np.int32, np.int64)):
                 return True
         return False
 
-
     def __iter__(self):
         self._iterator_index = 0
         return self
-- 
GitLab