From 1bb046e48b607626e6f4ba98e8abfacdcfa83194 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anian=20B=C3=BChler?=
 <anian.buehler@reutlingen-university.de>
Date: Mon, 24 Jan 2022 09:23:42 +0100
Subject: [PATCH] minor changes

---
 .../ardublock/simulator/simcode/datatypes/SimTypeInt.java  | 7 ++++---
 .../ardublock/simulator/simcode/datatypes/SimTypeLong.java | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeInt.java b/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeInt.java
index cef6cb1..6ce03c9 100644
--- a/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeInt.java
+++ b/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeInt.java
@@ -32,11 +32,12 @@ public class SimTypeInt extends SimCode {
 					value = (short) ret.getValue();
 				} catch (Exception e) {
 					//if a none-SimTypeInt Block is attached 
-					if(e.toString().contains("SimTypeLong")) {
+					try {
 						SimTypeLong ret = (SimTypeLong) followBlock.run(_arduino, functionHead);
 						value = (short) ret.getValue();
-					}else {
-						e.printStackTrace();
+					} catch (Exception e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
 					}
 				}	
 		}
diff --git a/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeLong.java b/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeLong.java
index 4b5f6a3..f235d90 100644
--- a/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeLong.java
+++ b/src/tec/letsgoing/ardublock/simulator/simcode/datatypes/SimTypeLong.java
@@ -32,11 +32,12 @@ public class SimTypeLong extends SimCode {
 				value = (int) ret.getValue();
 			} catch (Exception e) {
 				//if a none-SimTypeLong Block is attached 
-				if(e.toString().contains("SimTypeInt")) {
+				try {
 					SimTypeInt ret = (SimTypeInt) followBlock.run(_arduino, functionHead);
 					value = (short) ret.getValue();
-				}else {
-					e.printStackTrace();
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
 				}
 			}	
 		}
-- 
GitLab