diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp
index f4a5beb..3103efb 100644
--- a/toonz/sources/common/tsystem/tfilepath.cpp
+++ b/toonz/sources/common/tsystem/tfilepath.cpp
@@ -98,7 +98,7 @@ bool parseFrame(const std::wstring &str, int &frame, QString &letter, int &paddi
   wchar_t l = str[i] >= L'a' && str[i] <= L'z' ? str[i++]
             : str[i] >= L'A' && str[i] <= L'Z' ? str[i++]
             : L'\0';
-  if (number == 0 || i < (int)str.size())
+  if (digits <= 0 || i < (int)str.size())
     return false;
 
   frame = number;