Skip to content

Commit

Permalink
Fixed editor crash when setting "Property" to empty string then anyth…
Browse files Browse the repository at this point in the history
…ing else
  • Loading branch information
cstawarz committed Oct 17, 2012
1 parent 47b8dde commit 771548b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apps/editor/MWXMLNodeAdditions.m
Expand Up @@ -12,8 +12,7 @@
@implementation NSXMLNode (MWXMLNodeAdditions)

- (void)willChangeValueForKey:(NSString *)key{

if([self parent] != Nil){
if (key && [self parent]) {
[super willChangeValueForKey:key];
[[self parent] oneStepWillChangeValueForKey:[self name]];
[[self parent] oneStepWillChangeValueForKey:@"prettyXMLString"];
Expand All @@ -23,7 +22,7 @@ - (void)willChangeValueForKey:(NSString *)key{


- (void)didChangeValueForKey:(NSString *)key{
if([self parent] != Nil){
if (key && [self parent]) {
[super didChangeValueForKey:key];
[[self parent] oneStepDidChangeValueForKey:[self name]];
[[self parent] oneStepDidChangeValueForKey:@"prettyXMLString"];
Expand All @@ -32,8 +31,7 @@ - (void)didChangeValueForKey:(NSString *)key{
}

- (void)oneStepWillChangeValueForKey:(NSString *)key{

if([self parent] != Nil){
if (key && [self parent]) {
[super willChangeValueForKey:key];
[super willChangeValueForKey:[self name]];
[super willChangeValueForKey:@"prettyXMLString"];
Expand All @@ -43,7 +41,7 @@ - (void)oneStepWillChangeValueForKey:(NSString *)key{


- (void)oneStepDidChangeValueForKey:(NSString *)key{
if([self parent] != Nil){
if (key && [self parent]) {
[super didChangeValueForKey:key];
[super didChangeValueForKey:[self name]];
[super didChangeValueForKey:@"prettyXMLString"];
Expand Down

0 comments on commit 771548b

Please sign in to comment.