Uri.getLastPathSegment() may return null.

Don't crash if it does.