If you put a sensor near the slit, the wavefunction collapses and the probability amplitude is no longer the sum of the two, but they have to be treated separately. This corresponds to calculating both probabilities separately and then summing the probabilities. Since the pattern for each slit (on its own) is a line, we see two lines on the screen.