Fixes empty points in a line causing a nullpointer in main.js

This patch should fix a bug when lines contain zero points. In this case the line is just removed.