You would need to use the "utility" 'InitializeUserInput method before using the 'getinteger method. This controls what can be entered and is the VL equivalent to the Autolisp (initget)
(initget 7);; disallow null input (bit 1) disallow 0 (zero) input (bit 2) and disallow negative iteger (bit 4)
(setq integer (getint "\nEnter an Integer Value))
An (initget) only works for the next "getxxx" statement
The getXXX methods of the utility object will throw an exception for invalid input (which you would need to catch using vl-catch-all-apply/vl-catch-all-error-p) rather than gracefully returning nil.
Why not use getint?
Another method: Observe the following for a right mouse button context menu in a simple (getxx) call. Paste this in at the command prompt, then right click in the graphics screen.
(initget "One Two Three")
(setq opt (Getkword "\nSelect Option [One/Two/Three]: ")) ; Putting the Keywords in [] tells AutoLISP to make a context Menu.