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

Fix crash on Swift application when array item is NSNull #459

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Examples/SwiftExample/SwiftExample/RegistrationForm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class RegistrationForm: NSObject, FXForm {
var otherInterests = 0
var about: String?

var inlineArray: [String]?

var plan: Int = 0

var notifications: String?
Expand Down Expand Up @@ -111,6 +113,9 @@ class RegistrationForm: NSObject, FXForm {

[FXFormFieldKey: "about", FXFormFieldType: FXFormFieldTypeLongText],

// this is a inline array
[FXFormFieldKey: "inlineArray", FXFormFieldInline: true, FXFormFieldHeader: "Inline Array"],

//this is an options field that uses a FXFormOptionSegmentsCell to display the available
//options in a UIPickerView

Expand Down
2 changes: 2 additions & 0 deletions FXForms/FXForms.m
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,8 @@ - (void)updateFormValue
else
{
[collection addObjectsFromArray:self.values];
// remove NSNull. because crash in 'setValue' on Swift application.
[collection removeObjectIdenticalTo:[NSNull null]];
}

//set field value
Expand Down