Only give codemirror a value if there is one

@ian29 I ran into #262 this evening and tweaked this. If this fixes the issue for you then please merge!