- Possible fix for loading game styles scripts without .cfg file ios-revival
authorantonc27 <antonc27@mail.ru>
Sat, 24 Oct 2015 02:26:54 +0200
branchios-revival
changeset 11238 e529b597f9d1
parent 11237 4b833bb1621c
child 11239 a954853e9c00
- Possible fix for loading game styles scripts without .cfg file
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sat Oct 24 01:42:31 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sat Oct 24 02:26:54 2015 +0200
@@ -329,7 +329,7 @@
             }
             else
             {
-                if (![scheme isEqualToString:@"*"])
+                if (scheme && ![scheme isEqualToString:@"*"])
                 {
                     NSString *correctScheme = [scheme stringByReplacingOccurrencesOfString:@"_" withString:@" "];
                     self.selectedScheme = [NSString stringWithFormat:@"%@.plist", correctScheme];
@@ -345,7 +345,7 @@
             }
             else
             {
-                if (![weapon isEqualToString:@"*"])
+                if (weapon && ![weapon isEqualToString:@"*"])
                 {
                     NSString *correctWeapon = [weapon stringByReplacingOccurrencesOfString:@"_" withString:@" "];
                     self.selectedWeapon = [NSString stringWithFormat:@"%@.plist", correctWeapon];