[TIMODOPEN-265] Checking if error is nil in handleTransaction to avoid crash
Converting tabs to spaces for consistency