Bug? cursor1.GetBlob("pic").length is missing

Discussion in 'Bugs & wishlist' started by Alexander Stolte, Aug 2, 2018.

Tags:
  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    Hello,

    for example:
    Code:
    log(cursor1.GetBlob("pic").length)
    the ".length" is not displayed in the preview and if I want to print this through the log, then this error comes:
    Code:
    Error occurred on line: 2344 (Main2)
    java.lang.NullPointerException: Attempt 
    to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:621)
        at anywheresoftware.b4a.shell.Shell.getField(
    Shell.java:700)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:369)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:260)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    144)
        at anywheresoftware.b4a.BA$
    2.run(BA.java:365)
        at android.os.Handler.handleCallback(Handler.java:
    790)
        at android.os.Handler.dispatchMessage(Handler.java:
    99)
        at android.os.Looper.loop(Looper.java:
    164)
        at android.app.ActivityThread.main(ActivityThread.java:
    6753)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:
    482)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    807)
     
  2. Filippo

    Filippo Expert Licensed User

    A null object has no length.
     
  3. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    yes, but how should I check otherwise if it is NULL? under IOS the same code goes on a NULL object.
     
  4. Filippo

    Filippo Expert Licensed User

    Code:
    if cursor1.GetBlob("pic") <> null then
      
    log(cursor1.GetBlob("pic").length)
    end if
     
    KMatle and Alexander Stolte like this.
  5. mcqueccu

    mcqueccu Active Member Licensed User

    Create a Variable to receive the result then check the length.


    Code:
    Dim pic as string
    pic = cursor1.GetBlob(
    "pic")
    log(pic.length)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice