diff --git a/src/HighGUI.cc b/src/HighGUI.cc index 217917a..9c057fd 100644 --- a/src/HighGUI.cc +++ b/src/HighGUI.cc @@ -74,10 +74,12 @@ NamedWindow::BlockingWaitKey(const v8::Arguments& args){ //SETUP_FUNCTION(NamedWindow) int time = 0; - if (args.Length() > 0){ + if (args.Length() > 1){ time = args[1]->IntegerValue(); }else{ - time = args[0]->IntegerValue(); + if (args.Length() > 0){ + time = args[0]->IntegerValue(); + } } int res = cv::waitKey(time);