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

Alexander Stolte

Well-Known Member
Licensed User
Hello,

for example:
B4X:
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:
B4X:
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)
 

Filippo

Expert
Licensed User
A null object has no length.
 

Filippo

Expert
Licensed User
yes, but how should I check otherwise if it is NULL? under IOS the same code goes on a NULL object.
B4X:
if cursor1.GetBlob("pic") <> null then
  log(cursor1.GetBlob("pic").length)
end if
 
Top