Authored by 盖剑秋

add string null proctection.

@@ -2,70 +2,4 @@ @@ -2,70 +2,4 @@
2 <Bucket 2 <Bucket
3 type = "0" 3 type = "0"
4 version = "2.0"> 4 version = "2.0">
5 - <Breakpoints>  
6 - <BreakpointProxy  
7 - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">  
8 - <BreakpointContent  
9 - shouldBeEnabled = "Yes"  
10 - ignoreCount = "0"  
11 - continueAfterRunningActions = "No"  
12 - filePath = "YohoLive/Classes/YH_SocketService.m"  
13 - timestampString = "493980931.071469"  
14 - startingColumnNumber = "9223372036854775807"  
15 - endingColumnNumber = "9223372036854775807"  
16 - startingLineNumber = "342"  
17 - endingLineNumber = "342"  
18 - landmarkName = "-logout"  
19 - landmarkType = "5">  
20 - </BreakpointContent>  
21 - </BreakpointProxy>  
22 - <BreakpointProxy  
23 - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">  
24 - <BreakpointContent  
25 - shouldBeEnabled = "Yes"  
26 - ignoreCount = "0"  
27 - continueAfterRunningActions = "No"  
28 - filePath = "YohoLive/Classes/YH_SocketService.m"  
29 - timestampString = "493980931.071469"  
30 - startingColumnNumber = "9223372036854775807"  
31 - endingColumnNumber = "9223372036854775807"  
32 - startingLineNumber = "347"  
33 - endingLineNumber = "347"  
34 - landmarkName = "-logout"  
35 - landmarkType = "5">  
36 - </BreakpointContent>  
37 - </BreakpointProxy>  
38 - <BreakpointProxy  
39 - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">  
40 - <BreakpointContent  
41 - shouldBeEnabled = "Yes"  
42 - ignoreCount = "0"  
43 - continueAfterRunningActions = "No"  
44 - filePath = "YohoLive/Classes/YH_SocketService.m"  
45 - timestampString = "493980931.071469"  
46 - startingColumnNumber = "9223372036854775807"  
47 - endingColumnNumber = "9223372036854775807"  
48 - startingLineNumber = "350"  
49 - endingLineNumber = "350"  
50 - landmarkName = "-logout"  
51 - landmarkType = "5">  
52 - </BreakpointContent>  
53 - </BreakpointProxy>  
54 - <BreakpointProxy  
55 - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">  
56 - <BreakpointContent  
57 - shouldBeEnabled = "Yes"  
58 - ignoreCount = "0"  
59 - continueAfterRunningActions = "No"  
60 - filePath = "YohoLive/Classes/YH_SocketService.m"  
61 - timestampString = "493980917.098365"  
62 - startingColumnNumber = "9223372036854775807"  
63 - endingColumnNumber = "9223372036854775807"  
64 - startingLineNumber = "200"  
65 - endingLineNumber = "200"  
66 - landmarkName = "-socket:didConnectToHost:port:"  
67 - landmarkType = "5">  
68 - </BreakpointContent>  
69 - </BreakpointProxy>  
70 - </Breakpoints>  
71 </Bucket> 5 </Bucket>
@@ -245,15 +245,15 @@ @@ -245,15 +245,15 @@
245 [self toastTip:@"没有可用直播间"]; 245 [self toastTip:@"没有可用直播间"];
246 } 246 }
247 YH_ChannelModel *model = [YH_ChannelModel new]; 247 YH_ChannelModel *model = [YH_ChannelModel new];
248 - model.roomTitle = obj[@"name"];  
249 - model.roomURL = obj[@"url"];  
250 - model.channel_id = obj[@"channel_id"];  
251 - model.cid = obj[@"cid"];  
252 - model.app = obj[@"app"];  
253 - model.type = obj[@"type"];  
254 - model.room = obj[@"id"];  
255 - model.title = obj[@"title"];  
256 - model.secret = obj[@"secret"]; 248 + model.roomTitle = IsNilOrNull(obj[@"name"])?@"":obj[@"name"];
  249 + model.roomURL = IsNilOrNull(obj[@"url"])?@"":obj[@"url"];
  250 + model.channel_id = IsNilOrNull(obj[@"channel_id"])?@"":obj[@"channel_id"];
  251 + model.cid = IsNilOrNull(obj[@"cid"])?@"":obj[@"cid"];
  252 + model.app = IsNilOrNull(obj[@"app"])?@"":obj[@"app"];
  253 + model.type = IsNilOrNull(obj[@"type"])?@"":obj[@"type"];
  254 + model.room = IsNilOrNull(obj[@"id"])?@"":obj[@"id"];
  255 + model.title = IsNilOrNull(obj[@"title"])?@"":obj[@"title"];
  256 + model.secret = IsNilOrNull(obj[@"secret"])?@"":obj[@"secret"];
257 [tempAry addObject:model]; 257 [tempAry addObject:model];
258 if (_currentChannel&&[_currentChannel.roomURL isEqualToString:model.roomURL]) { 258 if (_currentChannel&&[_currentChannel.roomURL isEqualToString:model.roomURL]) {
259 _currentChannelIndex = idx; 259 _currentChannelIndex = idx;