diff --git a/Code/ControlPGN.py b/Code/ControlPGN.py index 1b60525..94dd222 100644 --- a/Code/ControlPGN.py +++ b/Code/ControlPGN.py @@ -158,8 +158,10 @@ def actual(self): rival = self.gestor.libro.nombre elif tipoJuego in (kJugFics, kJugFide): rival = self.gestor.nombreObj - else: + elif self.gestor.xrival: rival = self.gestor.xrival.nombre + else: + rival = ""; jugador = self.gestor.configuracion.jugador resultado = self.gestor.resultado diff --git a/Code/QT/Histogram.py b/Code/QT/Histogram.py index 49dc296..f7afb0f 100644 --- a/Code/QT/Histogram.py +++ b/Code/QT/Histogram.py @@ -431,8 +431,14 @@ def genHistograms(partida, sicentipawns): alm.lijgB = lijgB alm.porcT = porcT*1.0/len(lijg) - alm.porcW = porcW*1.0/len(lijgW) - alm.porcB = porcB*1.0/len(lijgB) + if len(lijgW) != 0: + alm.porcW = porcW*1.0/len(lijgW) + else: + alm.porcW = 0; + if len(lijgB) != 0: + alm.porcB = porcB*1.0/len(lijgB) + else: + alm.porcB = 0; return alm