Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options row causes crash in specific cases #232

Open
TigerWolf opened this issue Sep 7, 2014 · 0 comments
Open

Options row causes crash in specific cases #232

TigerWolf opened this issue Sep 7, 2014 · 0 comments

Comments

@TigerWolf
Copy link

If you use an options row like so:

  title: "Type",
        rows: [{
          title: "Type",
          key: :type,
          type: :options,
          items: ["Pushes", "Squat", "Km", "Stairs"]
          },{

then the app crashes.

If I change "Pushes" to "Push" - it doesn't crash. "aPu" also crashes. I cant define a pattern of an easily testable problem.

then the the app crashes on:
https://github.com/clayallsopp/formotion/blob/master/lib/formotion/row_type/options_row.rb#L14

2014-09-07 19:06:06.757 FitnessChallenge[85250:70b] options_row.rb:14:in `build_cell:': can't convert nil into Integer (TypeError)
    from row_cell_builder.rb:38:in `make_cell:'
    from row.rb:356:in `make_cell'
    from form_delegate.rb:67:in `tableView:cellForRowAtIndexPath:'
2014-09-07 19:06:06.758 FitnessChallenge[85250:70b] options_row.rb:14:in `build_cell:': can't convert nil into Integer (TypeError)
    from row_cell_builder.rb:38:in `make_cell:'
    from row.rb:356:in `make_cell'
    from form_delegate.rb:67:in `tableView:cellForRowAtIndexPath:'
2014-09-07 19:06:06.764 FitnessChallenge[85250:70b] *** Terminating app due to uncaught exception 'TypeError', reason: 'options_row.rb:14:in `build_cell:': can't convert nil into Integer (TypeError)
    from row_cell_builder.rb:38:in `make_cell:'
    from row.rb:356:in `make_cell'
    from form_delegate.rb:67:in `tableView:cellForRowAtIndexPath:'
'
*** First throw call stack:
(
    0   CoreFoundation                      0x026fb1e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x00b228e5 objc_exception_throw + 44
    2   FitnessChallenge                    0x007380aa _ZL10__vm_raisev + 346
    3   FitnessChallenge                    0x00738188 rb_vm_raise + 216
    4   FitnessChallenge                    0x006393c1 rb_exc_raise + 17
    5   FitnessChallenge                    0x00632882 rb_raise + 146
    6   FitnessChallenge                    0x0066f940 rb_cstr_to_dbl + 0
    7   FitnessChallenge                    0x0066f630 rb_Integer + 16
    8   FitnessChallenge                    0x000610be vm_rval_to_int + 334
    9   FitnessChallenge                    0x0006acbf __unnamed_262 + 47
    10  FitnessChallenge                    0x00712899 rb_vm_dispatch + 5913
    11  FitnessChallenge                    0x0050ffdc vm_dispatch + 1100
    12  FitnessChallenge                    0x00518124 rb_scope__build_cell:__ + 1364
    13  FitnessChallenge                    0x0072c3dd _ZL20dispatch_rimp_callerPFP11objc_objectS0_P13objc_selectorzEmS1_iPKm + 46445
    14  FitnessChallenge                    0x00712d3a rb_vm_dispatch + 7098
    15  FitnessChallenge                    0x0044bd6c vm_dispatch + 1100
    16  FitnessChallenge                    0x004542ec rb_scope__make_cell:__ + 3020
    17  FitnessChallenge                    0x0072c3dd _ZL20dispatch_rimp_callerPFP11objc_objectS0_P13objc_selectorzEmS1_iPKm + 46445
    18  FitnessChallenge                    0x00712d3a rb_vm_dispatch + 7098
    19  FitnessChallenge                    0x004389ac vm_dispatch + 1100
    20  FitnessChallenge                    0x0044655e rb_scope__make_cell__ + 1070
    21  FitnessChallenge                    0x0072c3dd _ZL20dispatch_rimp_callerPFP11objc_objectS0_P13objc_selectorzEmS1_iPKm + 46445
    22  FitnessChallenge                    0x00712d3a rb_vm_dispatch + 7098
    23  FitnessChallenge                    0x003e6eec vm_dispatch + 1100
    24  FitnessChallenge                    0x003f0cfe rb_scope__tableView:cellForRowAtIndexPath:__ + 462
    25  FitnessChallenge                    0x003f0e0f __unnamed_57 + 95
    26  UIKit                               0x0185811f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412
    27  UIKit                               0x018581f3 -[UITableView _createPreparedCellForGlobalRow:] + 69
    28  UIKit                               0x01839ece -[UITableView _updateVisibleCellsNow:] + 2428
    29  UIKit                               0x0184e6a5 -[UITableView layoutSubviews] + 213
    30  UIKit                               0x017ce964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    31  libobjc.A.dylib                     0x00b3482b -[NSObject performSelector:withObject:] + 70
    32  QuartzCore                          0x0349045a -[CALayer layoutSublayers] + 148
    33  QuartzCore                          0x03484244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    34  QuartzCore                          0x034840b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    35  QuartzCore                          0x033ea7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    36  QuartzCore                          0x033ebb85 _ZN2CA11Transaction6commitEv + 393
    37  QuartzCore                          0x033ec258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    38  CoreFoundation                      0x026c336e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    39  CoreFoundation                      0x026c32bf __CFRunLoopDoObservers + 399
    40  CoreFoundation                      0x026a1254 __CFRunLoopRun + 1076
    41  CoreFoundation                      0x026a09d3 CFRunLoopRunSpecific + 467
    42  CoreFoundation                      0x026a07eb CFRunLoopRunInMode + 123
    43  GraphicsServices                    0x04f015ee GSEventRunModal + 192
    44  GraphicsServices                    0x04f0142b GSEventRun + 104
    45  UIKit                               0x0175ff9b UIApplicationMain + 1225
    46  FitnessChallenge                    0x00028b34 main + 212
    47  libdyld.dylib                       0x03cfd701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type TypeError
@TigerWolf TigerWolf changed the title Options row with spaces causes crash Options row with causes crash Sep 7, 2014
@TigerWolf TigerWolf changed the title Options row with causes crash Options row causes crash in specific cases Sep 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant