.contains function throwing error
i have a conditional statement saying “string.isnullorempty(message) or message.contains(”!")" but the portion checking for an ! is throwing a “object reference not set to the instance of an object” error. when i take out that portion, it runs fine. any ideas? thanks
you can use lazy evaluation so if the first expression returns true it will not check the second expression. just change the ‘or’ in your statement to ‘orelse’ so it would be:

“string.isnullorempty(message) orelse message.contains(”!")"
that error happens when there's no handle to close. i see you call the 'open()' and you're not getting an object reference error before closehandle(). check your memory.pointerwrite() function to make sure it's not doing a closehandle() prematurely. it sounds like you're calling closehandle() twice. Check if any of the values in the cells are null.  

If they are you need to modify your code to check for null conditions before using `ToString()`. if statements always check if an expression evaluates to the value of true. since you’re checking whether the value true  value true then it’ll run every time. as for the “purpose” of the if statement, it’s here to create a “block scope” within the “function scope”.

interestingly, if you remove … Your function works, but both the IF and the ELSE return an alert message that says its invalid.  

The first part - the IF - should return in the alert box "Valid SSN"  

I am assuming your input should be like this 123-45-1234


but do you need to tell the user the input is valid? Surely the alert should only be displayed if the input is invalid? So the if should return nothing. imho hi [@nathan\_lively](/u/nathan_lively) - i’m not as familiar with the limitations of the bubble api, but i think i see two problems that might be causing the error.

the list you’re sending should look like this: ["1:1 matched reference"]. each array value needs to be wrapped in quotes.

you probably also don’t need quo… [image] endermaz41:

didn't know what to put in the error portion

first of all, err(…) is a value, not a type. since err is a variant ("constructor" if you like) of enum result, if you invoke it, you get a value of type result. you won't get a value of the error type itself, much less a type.

… If I am not wrong, you are trying to read or loop through the rows from datatable. This error states that the datasource(DataTable) is not having any rows. To avoid this exception use this before you read or loop through datatable:  


```
if(dt.Rows.Count  > 0 ){
     //Do your stuff here.
}
```
  

  

  

--Amit actually, the problem is more likely the fact that you’re trying to call the description method on what is probably a record at that stage. try something like this:

display dialog (current application's nsstringfromrect(my frame())) as text The problem is in your document.ready script:



```
$("#datepicker").datepicker();
```

This is returning an error that it is not a function. I'm not sure how the actual call should be, but check the documentation on that. `out` parameters in SQL Server are fun. You have to repeat yourself *everywhere*.


Specifically, here, you've forgotten to mention it in the parameter list when calling the stored proc. `dbo.InsertPhones @model, @out` should be `dbo.InsertPhones @model, @out out`. There may also be a way to omit the parameter list from this string and instruct SQL Server that you're giving it a stored procedure name, not arbitrary query text, but I'm not sure how you would do that specifically here (with an `SqlCommand` object, it would be via the `CommandType` property).


If you're using an `out` parameter, the `select` at the end of the stored procedure is unnecessary, but I assume that was an attempt at a fix.