From 825bcda767d2bab9f470d81cd76b9e5985fbea9c Mon Sep 17 00:00:00 2001 From: Renaud G Date: Wed, 25 Dec 2019 03:48:11 +0100 Subject: Fix test of IF --- tests/dice/tst_dice.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/dice/tst_dice.cpp') diff --git a/tests/dice/tst_dice.cpp b/tests/dice/tst_dice.cpp index 98dcdc1..8d6c1ad 100644 --- a/tests/dice/tst_dice.cpp +++ b/tests/dice/tst_dice.cpp @@ -850,7 +850,11 @@ void TestDice::ifTest() node.run(nullptr); - auto text= dynamic_cast(ifNode.getNextNode()->getResult())->getText(); + QString text; + if(nullptr != ifNode.getNextNode()) + text= dynamic_cast(ifNode.getNextNode()->getResult())->getText(); + else + text= dynamic_cast(ifNode.getResult())->getText(); QCOMPARE(expectedResult, text); -- cgit v1.2.3-70-g09d2