]> source.dussan.org Git - gitea.git/commitdiff
Fix #319 (user not-logged in error)
authorAndrew Patton <andrew@acusti.ca>
Thu, 24 Jul 2014 22:23:46 +0000 (18:23 -0400)
committerAndrew Patton <andrew@acusti.ca>
Thu, 24 Jul 2014 22:23:46 +0000 (18:23 -0400)
public/js/app.js

index 7ffcbd4a3e2a5edb3d2b2290ccd4d78b4db87f0c..1b4fed7def443bd0b329b51b20c847dde8009d9d 100644 (file)
@@ -579,8 +579,11 @@ function initIssue() {
         var $attachedList = $("#attached-list");
         var $addButton = $("#attachments-button");
 
-        var fileInput = $("#attachments-input")[0];
-
+        var fileInput = document.getElementById("attachments-input");
+        
+        if (fileInput === null) {
+            return;
+        }
         fileInput.addEventListener("change", function(event) {
             $attachedList.empty();
             $attachedList.append("<b>Attachments:</b> ");