Update server.py

Added a try-except to solve the error with the empty defBuffer not converting to 0.