From 8be29202aa3db9ab3695bae94d1204ef0c0932b6 Mon Sep 17 00:00:00 2001 From: Philipp Henkel Date: Wed, 14 Mar 2018 03:24:10 +0100 Subject: [PATCH] Fix pointer check in serial redirect (#707) --- libs/core/serial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/serial.cpp b/libs/core/serial.cpp index 9a6688d1..ddb0ed6d 100644 --- a/libs/core/serial.cpp +++ b/libs/core/serial.cpp @@ -155,8 +155,8 @@ namespace serial { //% rx.fieldOptions.tooltips="false" //% blockGap=8 void redirect(SerialPin tx, SerialPin rx, BaudRate rate) { - MicroBitPin* txp = getPin(tx); if (!tx) return; - MicroBitPin* rxp = getPin(rx); if (!rx) return; + MicroBitPin* txp = getPin(tx); if (!txp) return; + MicroBitPin* rxp = getPin(rx); if (!rxp) return; uBit.serial.redirect(txp->name, rxp->name); uBit.serial.baud((int)rate);