Skip to content

Commit 12bb962

Browse files
committed
NULL-safe escapeHTML:
1 parent fb6abc7 commit 12bb962

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

GLFileView.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ - (void)closeView
242242

243243
+ (NSString *) escapeHTML:(NSString *)txt
244244
{
245+
if (txt == nil)
246+
return txt;
245247
NSMutableString *newTxt = [NSMutableString stringWithString:txt];
246248
[newTxt replaceOccurrencesOfString:@"&" withString:@"&" options:NSLiteralSearch range:NSMakeRange(0, [newTxt length])];
247249
[newTxt replaceOccurrencesOfString:@"<" withString:@"&lt;" options:NSLiteralSearch range:NSMakeRange(0, [newTxt length])];

0 commit comments

Comments
 (0)