Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Add do nothing if key for persistence is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
susieyy committed Nov 18, 2015
1 parent f155745 commit d3730e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,9 @@ - (NSString *)slk_keyForPersistency
- (void)slk_reloadTextView
{
NSString *key = [self slk_keyForPersistency];
if (key == nil) {
return;
}
NSString *cachedText = [[NSUserDefaults standardUserDefaults] objectForKey:key];

if (self.textView.text.length == 0 || cachedText.length > 0) {
Expand Down

0 comments on commit d3730e2

Please sign in to comment.