Failed Ajax request or invalid JSON returned on galley uploading

OJS 3.0.2
Got this error after pressing Add galley button on production stage.
Duplicated on a local machine.

PHP log:

PHP Fatal error: Uncaught Error: Call to a member function getFileType() on null in C:\\xampp\\htdocs\\site\\cache\\t_compile\\0b745f35359e4f640d4decc143a6146b6baf0ba5^%%C0^C03^C03E464D%%articleGalleyForm.tpl.php:44\nStack trace:\n#0 C:\\xampp\\htdocs\\site\\lib\\pkp\\lib\\vendor\\smarty\\smarty\\libs\\Smarty.class.php(1264): include()\n#1 C:\\xampp\\htdocs\\site\\lib\\pkp\\classes\\template\\PKPTemplateManager.inc.php(696): Smarty->fetch('controllers/gri...', NULL, '0b745f35359e4f6...', false)\n#2 C:\\xampp\\htdocs\\site\\lib\\pkp\\classes\\template\\PKPTemplateManager.inc.php(780): PKPTemplateManager->fetch('controllers/gri...', NULL, '0b745f35359e4f6...', false)\n#3 C:\\xampp\\htdocs\\site\\lib\\pkp\\classes\\form\\Form.inc.php(194): PKPTemplateManager->display('controllers/gri...', 'text/html', 'TemplateManager...', false)\n#4 C:\\xampp\\htdocs\\site\\controllers\\grid\\articleGalleys\\form\\ArticleGalleyForm.inc.php(75): Form->fetch(Object(Request))\n#5 C:\\xampp\\htdocs\\site\\controllers\\grid\\articleGalleys\\ArticleGalleyGridHandler.inc.php(268): ArticleGalleyForm->fetch(Object( in C:\\xampp\\htdocs\\site\\cache\\t_compile\\0b745f35359e4f640d4decc143a6146b6baf0ba5^%%C0^C03^C03E464D%%articleGalleyForm.tpl.php on line 44, referer: http://localhost/index.php/psp/workflow/index/21/5

JavaScript error (other submission):

http://localhost/index.php/psp/$$$call$$$/grid/article-galleys/article-galley-grid/add-galley?submissionId=4&_=1498050406702 500 (Internal Server Error)

Strikingly, but I have managed quickly localize and fix the problem.

Error arises from the fix, that have been recently applied. Forgot to put expression in round brackets: https://github.com/pkp/ojs/blob/master/templates/controllers/grid/articleGalleys/form/articleGalleyForm.tpl#L42

My bad…