Commit 7c1048d0 authored by Thomas Marrinan's avatar Thomas Marrinan

drag and drop unknown file types no longer crashes server


Former-commit-id: fdf201defc9bb35fca3758e0d9c4e5041b9a0db6
parent 92b46a72
......@@ -513,8 +513,9 @@ appLoader.prototype.loadFileFromLocalStorage = function(file, callback) {
appLoader.prototype.manageAndLoadUploadedFile = function(file, callback) {
var mime_type = file.headers['content-type'];
var app = this.mime2app[mime_type];
if(app === undefined) { callback(null); return }
var dir = this.app2dir[app];
var _this = this;
var url = path.join("uploads", dir, file.originalFilename);
var external_url = this.hostOrigin + encodeURI(url);
......
......@@ -988,6 +988,11 @@ function manageUploadedFiles(files) {
var file = files[key][0];
appLoader.manageAndLoadUploadedFile(file, function(appInstance) {
if(appInstance === null){
console.log("unrecognized file type: " + file.headers['content-type']);
return;
}
appInstance.id = getUniqueAppId();
broadcast('createAppWindow', appInstance, 'requiresFullApps');
broadcast('createAppWindowPositionSizeOnly', getAppPositionSize(appInstance), 'requiresAppPositionSizeTypeOnly');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment