prevent bash syntax errors if snippets are empty

Bug: 1160091
Change-Id: Id81a0e1476e30ccf01fa9c1c4830c65fe95e0834