diff --git a/Base64/MF_AppDelegate.m b/Base64/MF_AppDelegate.m index 3d2d2b5..1e59be3 100755 --- a/Base64/MF_AppDelegate.m +++ b/Base64/MF_AppDelegate.m @@ -52,7 +52,14 @@ -(void)decode:(id)sender NSString *encoded = [_textField stringValue]; NSData *data = [NSData dataWithBase64String:encoded]; NSString *raw = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - [_textField setStringValue:raw]; + if( raw ) + { + [_textField setStringValue:raw]; + } + else + { + [_textField setStringValue:[NSString stringWithFormat:@"WARNING: data could not be converted to a NSString, dumping decoded binary data: %@", data]]; + } } @end