Nosskirneh/SpotifyHistory

Crash when building settings donate button

Closed this issue · 1 comments

Crash when building settings donate button

Description

The History settings crash when you scroll to the bottom, when it builds the donate button

How to Reproduce

  1. Open Spotify
  2. Open the History tab
  3. Click the settings button
  4. Scroll to the donate button
  5. CRASH

Actual Behavior

Scrolling to the donate button crashes the app

Expected Behavior

Scrolling to the bottom would show the rest of the settings

Additional Info

iOS: 9.3.3
Spotify: 8.4.43.908

The exception is being thrown because of these lines;

cell.button.glueStyle.normalBackgroundColor = [UIColor colorWithRed:0.11 green:0.73 blue:0.33 alpha:1.0]; // #1DB954
cell.button.glueStyle.highlightedBackgroundColor = [UIColor colorWithRed:0.08 green:0.51 blue:0.23 alpha:1.0]; // #14823B

The exception: 'NSInvalidArgumentException', reason: '-[SettingsMultipleChoiceIntegerTableViewCell button]: unrecognized selector

I have no idea why it thinks that the SPTSettingsButtonTableViewCell is a SettingsMultipleChoiceIntegerTableViewCell , but it does.

Current Workaround

Throw a try clause around those two lines

Thanks for noticing! This happens because you're running a small device I suppose. My 6 (running a 6+ resolution didn't catch this, nor my iPad). Just booted up my 5C and sure thing it crashes.

This happens when it recycles the cell and using the same identifier (thus a cell with another class can be handed). Fixed in fdfe19e.