Check there is input left before parse

Signed-off-by: K-ballo <k@fusionfenix.com>