From 4cdd27f7594d3608fd799c0b4c9e882cf100d731 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 13 Jun 2014 23:01:23 +0000
Subject: [PATCH] fix crash with slider

---
 contrib/mobile/iOS/Onelab/Onelab-Info.plist           | 4 ++--
 contrib/mobile/iOS/Onelab/ParametersViewController.mm | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/contrib/mobile/iOS/Onelab/Onelab-Info.plist b/contrib/mobile/iOS/Onelab/Onelab-Info.plist
index 27ba696f01..fba6675712 100644
--- a/contrib/mobile/iOS/Onelab/Onelab-Info.plist
+++ b/contrib/mobile/iOS/Onelab/Onelab-Info.plist
@@ -35,11 +35,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.4</string>
+	<string>1.0.5</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>1.0.4</string>
+	<string>1.0.5</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UIFileSharingEnabled</key>
diff --git a/contrib/mobile/iOS/Onelab/ParametersViewController.mm b/contrib/mobile/iOS/Onelab/ParametersViewController.mm
index 555d0861dd..e77288f06e 100644
--- a/contrib/mobile/iOS/Onelab/ParametersViewController.mm
+++ b/contrib/mobile/iOS/Onelab/ParametersViewController.mm
@@ -112,7 +112,10 @@
     ParameterNumberStepper *param = [[ParameterNumberStepper alloc] initWithNumber:p];
     [section addObject:param];
   }
-  else if(p.getMin() == p.getMax() || p.getReadOnly()) { // text box
+  else if(p.getMin() >= p.getMax() ||
+          p.getMin() == -onelab::number::maxNumber() ||
+          p.getMax() == onelab::number::maxNumber() ||
+          p.getReadOnly()) { // text box
     ParameterNumberTextbox *param = [[ParameterNumberTextbox alloc] initWithNumber:p];
     [section addObject:param];
   }
-- 
GitLab