Value is empty and 'isEmpty' function cannot be applied

Value is empty and 'isEmpty' function cannot be applied


I am having a very strange error in my custom  function with Deluge. It is a function that creates. invoices automatically every Friday if the sales order is shipped. I added a verification to know if the customer has credit notes actives. If the costumer has some credits, the invoice is not created. 
The thing is I am receiving the error you see in the title "Check and update the code in line 76 as there is a Exception : Value is empty and 'isEmpty' function cannot be applied"

  1. urlcredit = "" + organizationID + "&customer_id=" + customerID + "&status=open";
  2. credit_note = invokeurl
  3. [
  4. url :urlcredit
  5. type :GET
  6. connection:"v2_books_conpas"
  7. ];
  8. comp_tienecredito = credit_note.get("creditnotes");
  9. if(comp_tienecredito.isEmpty() == false)
  10. {
  11. tieneCredito = true;
  12. numeroCreditos = numeroCreditos + 1;
  13. }

          Zoho TeamInbox Resources

            Zoho DataPrep Resources

                Zoho CRM Plus Resources

                  Zoho Books Resources

                    Zoho Subscriptions Resources

                      Zoho Desk Resources

                        Zoho Projects Resources

                          Zoho Sprints Resources

                            Zoho Orchestly Resources

                              Zoho Creator Resources

                                Zoho WorkDrive Resources

                                    Zoho Campaigns Resources

                                      Zoho CRM Resources

                                                    Design. Discuss. Deliver.

                                                    Create visually engaging stories with Zoho Show.

                                                    Get Started Now

                                                      Zoho Show Resources

                                                        Zoho Writer Writer

                                                        Get Started. Write Away!

                                                        Writer is a powerful online word processor, designed for collaborative work.