ej2 / python-quickbooks

A Python library for accessing the Quickbooks API.
MIT License
394 stars 193 forks source link

TypeError coming from mixins.py #349

Open nathan-gilbert opened 5 months ago

nathan-gilbert commented 5 months ago

Hi,

I'm seeing a TypeError being emitted from this library occasionally. Specifically at

File "<omitted>/quickbooks/mixins.py", line 333, in query
     if object_name in json_data["QueryResponse"]:                                                                                                                                                                                                                                                
                       ~~~~~~~~~^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                          
     TypeError: 'NoneType' object is not subscriptable   

It looks like qb.query(select) can return None (maybe when no results are returned? Maybe API error?) This causes TypeError to be thrown outside of the library itself because of trying access a property on a None object.