Skip to content

Commit

Permalink
Fixed some wrong comparisons
Browse files Browse the repository at this point in the history
Fixed some wrong comparisons
  • Loading branch information
silvae86 committed Jun 15, 2017
1 parent 9e929ce commit 880006e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/controllers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ exports.upload = function(req, res)
if (req.originalMethod === "GET")
{
if (
typeof upload_id !== "undefined" &&
typeof upload_id !== "" &&
!isNull(upload_id) &&
upload_id !== "" &&
!isNull(username)
)
{
Expand Down Expand Up @@ -938,7 +938,7 @@ exports.upload = function(req, res)
}
};

if (typeof typeof upload != null)
if (!isNull(upload))
{
const multiparty = require('multiparty');
const form = new multiparty.Form({maxFieldSize: 8192, maxFields: 10, autoFiles: false});
Expand Down
4 changes: 2 additions & 2 deletions src/kb/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ DbConnection.addLimitsClauses = function(query, offset, maxResults)
DbConnection.pushLimitsArguments = function(unpaginatedArgumentsArray, maxResults, offset)
{
if(!isNull(offset) &&
typeof offset === "int" &&
typeof offset === "number" &&
offset > 0)
{
unpaginatedArgumentsArray = unpaginatedArgumentsArray.push({
Expand All @@ -437,7 +437,7 @@ DbConnection.pushLimitsArguments = function(unpaginatedArgumentsArray, maxResult
}

if(!isNull(maxResults) &&
typeof maxResults === "int" &&
typeof maxResults === "number" &&
maxResults > 0)
{
unpaginatedArgumentsArray = unpaginatedArgumentsArray.push({
Expand Down
2 changes: 1 addition & 1 deletion src/models/directory_structure/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ File.createBlankFileRelativeToAppRoot = function(relativePathToFile, callback)
fs.stat(absPathToFile, function(err, stat) {
if(isNull(err)) {
callback(0, absPathToFile, parentFolder);
} else if(typeof err.code === 'ENOENT') {
} else if(err.code === 'ENOENT') {
// file does not exist
const mkpath = require('mkpath');

Expand Down

0 comments on commit 880006e

Please sign in to comment.