• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheで画像のインラインプレビューを可能にするプラグイン


Commit MetaInfo

Revisionedef7ca3a1c56c83f4ff19664f4a8584668047bd (tree)
Time2012-08-05 23:23:43
Authormasakih <masakih@user...>
Commitermasakih

Log Message

[Fix] urlが正しく取得出来ない場合落ちるバグを修正

Change Summary

Incremental Difference

--- a/Ex/BSIPEReplacer.m
+++ b/Ex/BSIPEReplacer.m
@@ -168,7 +168,14 @@ NSRange fixRange(NSRange range, NSTextStorage *ts)
168168 inRange:NSMakeRange(0, [ts length])
169169 options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired
170170 usingBlock:^(id value, NSRange range, BOOL *stop) {
171- NSURL *url = [NSURL URLWithString:value];
171+ NSURL *targetURL = nil;
172+ if([value isKindOfClass:[NSString class]]) {
173+ targetURL = [NSURL URLWithString:value];
174+ }
175+ if([value isKindOfClass:[NSURL class]]) {
176+ targetURL = value;
177+ }
178+ if(!targetURL) return;
172179 if([self.owner validateLink:url]) {
173180 [links addObject:[NSDictionary dictionaryWithObjectsAndKeys:url, BSIPELinkKey,
174181 NSStringFromRange(range), BSIPERangeKey, nil]];