Fix battle log print 'undefined' at the first time