diff --git a/lib/model/model.go b/lib/model/model.go
index <HASH>..<HASH> 100644
--- a/lib/model/model.go
+++ b/lib/model/model.go
@@ -1168,6 +1168,10 @@ func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) {
 	m.fmut.RLock()
 	files := m.folderFiles[folder]
 	m.fmut.RUnlock()
+	if files == nil {
+		// The folder doesn't exist.
+		return
+	}
 	files.Update(protocol.LocalDeviceID, fs)
 
 	filenames := make([]string, len(fs))
diff --git a/lib/model/rwfolder.go b/lib/model/rwfolder.go
index <HASH>..<HASH> 100644
--- a/lib/model/rwfolder.go
+++ b/lib/model/rwfolder.go
@@ -527,6 +527,13 @@ func (p *rwFolder) pullerIteration(ignores *ignore.Matcher) int {
 
 nextFile:
 	for {
+		select {
+		case <-p.stop:
+			// Stop processing files if the puller has been told to stop.
+			break
+		default:
+		}
+
 		fileName, ok := p.queue.Pop()
 		if !ok {
 			break
Don't crash on folder remove while pulling (fixes #<I>)