DOMjudge/domjudge — pull request #124 by ubergeek42 (2013-10-06 18:41:40+00:00)
Title: Fix bug with cancelling file uploads

If you choose a file(for example, on the edit problem page for "problem text"), and then choose cancel, the file upload will attempt to happen but since it won't have the primary key ID to write to(and since you don't actually want it to happen), you get a nice sql error due to the missing WHERE clause.

This simple fix just moves that block inside the check for the cancel button, which solves this problem.