Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4280)

Unified Diff: chrome/renderer/resources/json_schema.js

Issue 7787004: Fix crash when calling chrome.tabs.move({index:-1}). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix issue min/max validation Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/json_schema.js
diff --git a/chrome/renderer/resources/json_schema.js b/chrome/renderer/resources/json_schema.js
index 8f588b2f45b445aa37138410a8bb5f5e3d1f6efd..ad47748ae0c5bd90f3becc5baefb23e8e9946df5 100644
--- a/chrome/renderer/resources/json_schema.js
+++ b/chrome/renderer/resources/json_schema.js
@@ -405,10 +405,10 @@ chromeHidden.JSONSchemaValidator.prototype.validateNumber = function(
instance == Number.NEGATIVE_INFINITY )
this.addError(path, "numberFiniteNotNan", [instance]);
- if (schema.minimum && instance < schema.minimum)
+ if (schema.minimum !== undefined && instance < schema.minimum)
this.addError(path, "numberMinValue", [schema.minimum]);
- if (schema.maximum && instance > schema.maximum)
+ if (schema.maximum !== undefined && instance > schema.maximum)
this.addError(path, "numberMaxValue", [schema.maximum]);
// Check for integer values outside of -2^31..2^31-1.

Powered by Google App Engine
This is Rietveld 408576698