Bläddra i källkod

check if moveToPost is defined before parsing n/p hotkeys (3)

Andrew Dolgov 18 år sedan
förälder
incheckning
746a0d5eb3
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      functions.js

+ 2 - 2
functions.js

@@ -203,13 +203,13 @@ function hotkey_handler(e) {
 		}
 
 		if (keycode == 78 || keycode == 40) { // n, down
-			if (h_ctx.moveToPost != undefined) {
+			if (typeof h_ctx.moveToPost != 'undefined') {
 				return h_ctx.moveToPost('next');
 			}
 		}
 	
 		if (keycode == 80 || keycode == 38) { // p, up
-			if (h_ctx.moveToPost != undefined) {
+			if (typeof h_ctx.moveToPost != 'undefined') {
 				return h_ctx.moveToPost('prev');
 			}
 		}