Skip to content

Commit

Permalink
fixed Xcode crash bug #14
Browse files Browse the repository at this point in the history
  • Loading branch information
金聖輝 committed Jul 15, 2015
1 parent 2fb4797 commit ca5b9f9
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions KSHObjcUML/KSHObjcUML.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,38 @@ + (NSBundle *)pluginBundle

- (NSString *)scriptPath
{
return [[self.directoryPath stringByAppendingPathComponent:FOLDAR_NAME] stringByAppendingPathComponent:@"script.rb"];
NSString *tempScriptPath = [[self.directoryPath stringByAppendingPathComponent:FOLDAR_NAME] stringByAppendingPathComponent:@"script.rb"];
if (tempScriptPath) {
_scriptPath = tempScriptPath;
}
return _scriptPath;
}

- (NSString *)projectName
{
return [VWKProject projectForKeyWindow].projectOriginalName;
NSString *tempProjectName = [VWKProject projectForKeyWindow].projectOriginalName;
if (tempProjectName) {
_projectName = tempProjectName;
}
return _projectName;
}

- (NSString *)zipFilePath
{
return [[KSHObjcUML pluginBundle] pathForResource:FOLDAR_NAME ofType:@"zip"];
NSString *tempZipFilePath = [[KSHObjcUML pluginBundle] pathForResource:FOLDAR_NAME ofType:@"zip"];
if (tempZipFilePath) {
_zipFilePath = tempZipFilePath;
}
return _zipFilePath;
}

- (NSString *)directoryPath
{
return [VWKProject projectForKeyWindow].directoryPath;
NSString *tempDirectoryPath = [VWKProject projectForKeyWindow].directoryPath;
if (tempDirectoryPath) {
_directoryPath = tempDirectoryPath;
}
return _directoryPath;
}

+ (void)pluginDidLoad:(NSBundle *)plugin
Expand Down

0 comments on commit ca5b9f9

Please sign in to comment.