Have you tried placing your code within the Try statement? Personally I would try the code below. If that does not work then just change your SQL query to replace Null with a 0.
Just a quick guess as I'm typing using my phone.
B4X:
Try
Number = Cursor.GetString("number")
Catch
Log(LastException.Message)
Return
End Try