I'm not sure this kind of check is needed in the first place. If someone wrote garbage as value a check like -gt 0 would return false anyways. A warning from bash is no surprise in that case.