Add null check in UpsertCompiler to make views with no where clause not NPE