Fix EZP-22761 - 500 Internal Server Error after request #133 from nlescure/patch-1

Link: https://jira.ez.no/browse/EZP-22761