From 7bd27ebd520492a22e2bfbc9f693eae9100a9dc4 Mon Sep 17 00:00:00 2001 From: Mathieu Monney Date: Tue, 24 Jun 2014 15:37:59 +0200 Subject: [PATCH] Fixed: Crash of press tool due to theme attribute not set When using the press tool, it can happen that one of the theme attribute is not set as not everything is instantiated. This fix makes sure that the attribute is set before accessing it to avoid any crash of the press tool. --- AppKit/CPTheme.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTheme.j b/AppKit/CPTheme.j index 345a3a56b..36a1b7c91 100644 --- a/AppKit/CPTheme.j +++ b/AppKit/CPTheme.j @@ -774,7 +774,7 @@ function CPThemeAttributeDecode(aCoder, anAttributeName, aDefaultValue, aTheme, { var attribute = [aCoder decodeObjectForKey:key]; - if (!attribute.isa || ![attribute isKindOfClass:[_CPThemeAttribute class]]) + if (!attribute || !attribute.isa || ![attribute isKindOfClass:[_CPThemeAttribute class]]) { var themeAttribute = [[_CPThemeAttribute alloc] initWithName:anAttributeName defaultValue:aDefaultValue];