confused on this error

I'm having trouble understanding what this error is trying to tell me
void square_manager+<ListInvoices>d__5.MoveNext(): System.NullReferenceException: Object reference not set to an instance of an object.
void square_manager+<ListInvoices>d__5.MoveNext(): System.NullReferenceException: Object reference not set to an instance of an object.
manager_invoices.cs
ListInvoicesResponse result = await square_manager.ListInvoices();
ListInvoicesResponse result = await square_manager.ListInvoices();
square_manager.cs
public static async Task<ListInvoicesResponse> ListInvoices() {
try {
var result = await client.InvoicesApi.ListInvoicesAsync(locationId: null);
return result;
}
public static async Task<ListInvoicesResponse> ListInvoices() {
try {
var result = await client.InvoicesApi.ListInvoicesAsync(locationId: null);
return result;
}
2 Replies
canton7
canton7•2mo ago
Either client, or clinet.InvoicesApi is null, most likely? The exception will have a stack trace which will give you more information
🌸 morgan period 🌸
I'm confused on how I would get ListInvoices from another script I understand why client is null, because it's accessing the script itself not the reference I've made with client being created
Want results from more Discord servers?
Add your server