Closed aamenmuh closed 9 months ago
the getXXX methods in ORM classes may return a nullptr when the according column value is null, you should give it a check to avoid crashing when dereferencing the shared_ptr.
the getXXX methods in ORM classes may return a nullptr when the according column value is null, you should give it a check to avoid crashing when dereferencing the shared_ptr.
Oh thanks! I checked the internal working and it did indeed return a null pointer in one of my data points. No longer an issue.
Hello, I am trying to build a library system using drogon and angular. The design is that I have a large psql database of books that is hosted online and accessed by Drogon. The main controller maps every 10 books to a page number. (In total, there are 4000 books (i.e. 400 pages). Accessing the first 7 pages is fine and works as expected in both Angular via accessing drogon's local host in the webpage. For any larger index, it gives a seg fault and ends the get request and closes the connection. Here is the controller code:
Expected Not give any console output and display the json when accessing directly from drogon's url
Actual Seg Fauly displayed on index > 7.
Attempted fixes
I could not fix it, but I foud that the issue is in the line containing findAll. When commented out, everything else works fine, tho surely it does not give the desired output.