Skip to content

Commit b0baec7

Browse files
author
arch
committed
fix empty video string cause exception
1 parent bfdb1b4 commit b0baec7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

funscript_editor/ui/minimal.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ def __init__(self,
3838
if os.path.exists(output_file):
3939
os.remove(output_file)
4040

41+
if video_file is None or video_file == "":
42+
self.__show_message("Video file was not specified!", error=True)
43+
sys.exit()
44+
45+
if not os.path.exists(video_file):
46+
self.__show_message("Video file not found ({})".format(video_file), error=True)
47+
sys.exit()
48+
4149
cap = cv2.VideoCapture(video_file)
4250
fps = cap.get(cv2.CAP_PROP_FPS)
4351
cap.release()
@@ -53,14 +61,6 @@ def __init__(self,
5361
logging.info('Abort Funscript Generator')
5462
sys.exit()
5563

56-
if video_file is None or video_file == "":
57-
self.__show_message("Video file was not specified!", error=True)
58-
sys.exit()
59-
60-
if not os.path.exists(video_file):
61-
self.__show_message("Video file not found ({})".format(video_file), error=True)
62-
sys.exit()
63-
6464
reply = QtWidgets.QMessageBox.question(None, 'Track Men', 'Do you want to track the Men? ',
6565
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No)
6666
trackMen = True if reply == QtWidgets.QMessageBox.Yes else False

0 commit comments

Comments
 (0)