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

Fatal error: Unexpectedly found nil while unwrapping an Optional value #125

Open
PlutusCat opened this issue Nov 27, 2018 · 2 comments
Open

Comments

@PlutusCat
Copy link

PlutusCat commented Nov 27, 2018

Xcode 10.1
MacOS 10.14.1

I have some json code,and choose SwiftyJSON-Class , There will be a crash.

{
  "code" : "200",
  "message" : "匹配完成",
  "data" : {
    "stackTrace" : [
      {
        "nativeMethod" : false,
        "fileName" : "NullObject.java",
        "className" : "org.codehaus.groovy.runtime.NullObject",
        "lineNumber" : 60,
        "methodName" : "getProperty"
      },
      {
        "nativeMethod" : false,
        "fileName" : "InvokerHelper.java",
        "className" : "org.codehaus.groovy.runtime.InvokerHelper",
        "lineNumber" : 190,
        "methodName" : "getProperty"
      }
    ],
    "cause" : null,
    "localizedMessage" : "Cannot get property 'minimumAmount' on null object",
    "message" : "Cannot get property 'minimumAmount' on null object",
    "suppressed" : [

    ]
  }
}

On the FileRepresenter.swift In line No. 484, It's a null value.

// if needs cast
let cast = lang.basicTypesWithSpecialFetchingNeedsTypeCast[index]
@wangela
Copy link

wangela commented Dec 4, 2018

+1 on this, also running on
Xcode 10.1
MacOS 10.14.1

Console also says
2018-12-04 10:48:23.151777-0800 JSONExport[14745:1985495] [default] Unable to load Info.plist exceptions (eGPUOverrides) (lldb)

@brianramirez
Copy link

I ran into this same issue with SwiftyJSON just now with my JSON structure. I think that the JSONExport tool is barfing with creating the Constructors for SwiftyJSON when the JSON has empty arrays. As soon as I provided values for my empty arrays, the tool works perfectly.

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

3 participants